No description
Find a file
Ed Page f70ebe89a7 fix!: Require explicit help/version disabling
Before we introduced actions, it required specific setups to engage with
claps version and help printing.  With actions making that more
explicit, we don't get as much benefit from our multiple, obscure, ways
of users customizing help

Before
- Modify existing help or version with `mut_arg` which would
  automatically be pushed down the command tree like `global(true)`
- Create an new help or version and have it treated as if it was the
  built-in on (I think)
- Use the same flags as built-in and have the built-in flags
  automatically disabled
- Users could explicitly disable the built-in functionality and do what
  they want

Now
- `mut_arg` no longer works as we define help and version flags at the
  end
- If someone defines a flag that overlaps with the built-ins by id,
  long, or short, a debug assert will tell them to explicitly disable
  the built-in
- Any customization has to be done by a user providing their own.  To
  propagate through the command tree, they need to set `global(true)`.

Benefits
- Hopefully, this makes it less confusing on how to override help
  behavior.  Someone creates an arg and we then tell them how to disable
  the built-in
- This greatly simplifies the arg handling by pushing more
  responsibility onto the developer in what are hopefully just corner
  cases
- This removes about 1Kb from .text

Fixes #3405
Fixes #4033
2022-08-10 20:33:21 -05:00
.github chore(gh): Start v3 development 2022-07-21 12:30:15 -05:00
assets docs: Add back in logo 2021-12-07 17:45:57 -06:00
clap_bench fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
clap_complete fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
clap_complete_fig fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
clap_derive fix(derive): Add "id" attribute 2022-08-09 12:15:02 -07:00
clap_lex chore: Release 2022-06-28 08:04:18 -05:00
clap_mangen fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
examples docs(tutorial): Further expand on actions 2022-08-09 16:33:02 -05:00
src fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
tests fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
.clippy.toml chore: Bump MSRV from 1.56.0 to 1.56.1 2022-06-17 09:01:45 -05:00
.gitignore chore: Allow testing MSRV 2022-07-19 13:50:27 -05:00
.pre-commit-config.yaml chore: Upgrade boilerplate 2022-02-15 12:36:19 -06:00
Cargo.lock Merge pull request #4011 from clap-rs/dependabot/cargo/proc-macro2-1.0.42 2022-08-01 09:23:56 -05:00
Cargo.toml docs(tutorial): Further expand on actions 2022-08-09 16:33:02 -05:00
CHANGELOG.md fix!: Require explicit help/version disabling 2022-08-10 20:33:21 -05:00
committed.toml chore: Align on boilerplate 2021-11-17 15:24:50 -06:00
CONTRIBUTING.md docs(contrib): Say why we use feature flag 2022-08-09 10:23:23 -05:00
LICENSE-APACHE chore: relicense under MIT and APACHE 2.0 2018-07-23 14:25:18 -04:00
LICENSE-MIT docs(license): Update years/holders 2022-06-27 12:55:09 -05:00
Makefile fix!: Remove unstable-v4 feature gate 2022-07-22 11:34:06 -05:00
README.md chore: Update release process 2022-07-19 14:41:42 -05:00
release.toml chore: Allow releasing from release branches 2022-07-25 13:31:25 -05:00
typos.toml docs: Fix typos 2021-11-17 15:21:58 -06:00

clap

Command Line Argument Parser for Rust

Crates.io Crates.io License License Build Status Coverage Status Contributors

Dual-licensed under Apache 2.0 or MIT.

About

Create your command-line parser, with all of the bells and whistles, declaratively or procedurally.

For more details, see:

Sponsors

Gold

Silver

Bronze

Backer