From a6e173c0830daee881002957561fe6744a56badf Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 26 Aug 2022 09:40:23 -0500 Subject: [PATCH] fix(help): Don't rely on ALL CAPS for headers I see them fulfilling two roles - A form of bolding - As a callback to their placeholder in usage However, it is a bit of an unpolished look and no other CLI seems to do it. This looks a bit more proefessional. We have colored help for formatting and I think the sections relation to usage will be clear enough. --- CHANGELOG.md | 2 + examples/cargo-example-derive.md | 10 +- examples/cargo-example.md | 10 +- examples/demo.md | 4 +- examples/derive_ref/custom-bool.md | 8 +- examples/derive_ref/interop_tests.md | 18 +- examples/escaped-positional-derive.md | 8 +- examples/escaped-positional.md | 8 +- examples/find.md | 4 +- examples/git-derive.md | 40 +-- examples/git.md | 40 +-- examples/multicall-busybox.md | 4 +- examples/pacman.md | 14 +- examples/tutorial_builder/01_quick.md | 8 +- examples/tutorial_builder/02_app_settings.md | 4 +- examples/tutorial_builder/02_apps.md | 4 +- examples/tutorial_builder/02_crate.md | 4 +- examples/tutorial_builder/03_01_flag_bool.md | 4 +- examples/tutorial_builder/03_01_flag_count.md | 4 +- examples/tutorial_builder/03_02_option.md | 4 +- .../tutorial_builder/03_02_option_mult.md | 4 +- examples/tutorial_builder/03_03_positional.md | 6 +- .../tutorial_builder/03_03_positional_mult.md | 6 +- .../tutorial_builder/03_04_subcommands.md | 18 +- .../tutorial_builder/03_05_default_values.md | 6 +- examples/tutorial_builder/04_01_enum.md | 6 +- examples/tutorial_builder/04_01_possible.md | 6 +- examples/tutorial_builder/04_02_parse.md | 6 +- examples/tutorial_builder/04_02_validate.md | 6 +- examples/tutorial_builder/04_03_relations.md | 12 +- examples/tutorial_builder/04_04_custom.md | 12 +- examples/tutorial_derive/01_quick.md | 8 +- examples/tutorial_derive/02_app_settings.md | 4 +- examples/tutorial_derive/02_apps.md | 4 +- examples/tutorial_derive/02_crate.md | 4 +- examples/tutorial_derive/03_01_flag_bool.md | 4 +- examples/tutorial_derive/03_01_flag_count.md | 4 +- examples/tutorial_derive/03_02_option.md | 4 +- examples/tutorial_derive/03_02_option_mult.md | 4 +- examples/tutorial_derive/03_03_positional.md | 6 +- .../tutorial_derive/03_03_positional_mult.md | 6 +- examples/tutorial_derive/03_04_subcommands.md | 18 +- .../tutorial_derive/03_05_default_values.md | 6 +- examples/tutorial_derive/04_01_enum.md | 6 +- examples/tutorial_derive/04_02_parse.md | 6 +- examples/tutorial_derive/04_02_validate.md | 6 +- examples/tutorial_derive/04_03_relations.md | 12 +- examples/tutorial_derive/04_04_custom.md | 12 +- examples/typed-derive.md | 4 +- src/output/help.rs | 12 +- src/output/usage.rs | 2 +- tests/builder/app_settings.rs | 24 +- tests/builder/arg_aliases.rs | 8 +- tests/builder/arg_aliases_short.rs | 8 +- tests/builder/cargo.rs | 8 +- tests/builder/command.rs | 4 +- tests/builder/conflicts.rs | 10 +- tests/builder/default_vals.rs | 2 +- tests/builder/derive_order.rs | 36 +- tests/builder/display_order.rs | 6 +- tests/builder/double_require.rs | 8 +- tests/builder/empty_values.rs | 2 +- tests/builder/error.rs | 14 +- tests/builder/flag_subcommands.rs | 12 +- tests/builder/flags.rs | 4 +- tests/builder/groups.rs | 12 +- tests/builder/help.rs | 336 +++++++++--------- tests/builder/help_env.rs | 32 +- tests/builder/hidden_args.rs | 36 +- tests/builder/multiple_values.rs | 4 +- tests/builder/opts.rs | 6 +- tests/builder/positionals.rs | 10 +- tests/builder/require.rs | 24 +- tests/builder/subcommands.rs | 48 +-- tests/builder/template_help.rs | 26 +- tests/derive/author_version_about.rs | 2 +- tests/derive/doc_comments_help.rs | 10 +- tests/derive/help.rs | 20 +- tests/macros.rs | 4 +- tests/ui/arg_required_else_help_stderr.toml | 8 +- tests/ui/error_stderr.toml | 4 +- tests/ui/h_flag_stdout.toml | 8 +- tests/ui/help_cmd_stdout.toml | 8 +- tests/ui/help_flag_stdout.toml | 8 +- 84 files changed, 592 insertions(+), 582 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25891b8d0dc5..6516b5d99759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Removed lifetimes from `Command`, `Arg`, `ArgGroup`, and `PossibleValue` - *(help)* Make `DeriveDisplayOrder` the default and removed the setting. To sort help, set `next_display_order(None)` (#2808) - *(help)* Subcommand display order respects `Command::next_display_order` instead of `DeriveDisplayOrder` and using its own initial display order value (#2808) +- *(help)* Help headings are now title cased, making any user-provided help headings inconsistent - *(env)* Parse `--help` and `--version` like any `ArgAction::SetTrue` flag (#3776) - *(derive)* Changed the default for arguments from `parse` to `value_parser`., removing `parse` support - *(derive)* `subcommand_required(true).arg_required_else_help(true)` is set instead of `SubcommandRequiredElseHelp` (#3280) @@ -83,6 +84,7 @@ MSRV is now 1.60.0 - *(help)* Use `Command::display_name` in the help title rather than `Command::bin_name` - *(help)* Show when a flag is `ArgAction::Count` by adding an `...` - *(help)* Use a more neutral palette for coloring +- *(help)* Don't rely on ALL CAPS for help headers - *(version)* Use `Command::display_name` rather than `Command::bin_name` - *(parser)* Assert on unknown args when using external subcommands (#3703) - *(parser)* Always fill in `""` argument for external subcommands (#3263) diff --git a/examples/cargo-example-derive.md b/examples/cargo-example-derive.md index c046f104c1e5..98cf2f6cfb7a 100644 --- a/examples/cargo-example-derive.md +++ b/examples/cargo-example-derive.md @@ -8,13 +8,13 @@ The help looks like: $ cargo-example-derive --help cargo -USAGE: +Usage: cargo -OPTIONS: +Options: -h, --help Print help information -SUBCOMMANDS: +Subcommands: example-derive A simple to use, efficient, and full-featured Command Line Argument Parser help Print this message or the help of the given subcommand(s) @@ -22,10 +22,10 @@ $ cargo-example-derive example-derive --help cargo-example-derive [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: cargo example-derive [OPTIONS] -OPTIONS: +Options: --manifest-path -h, --help Print help information -V, --version Print version information diff --git a/examples/cargo-example.md b/examples/cargo-example.md index e83d3faa1030..98cd01b443fc 100644 --- a/examples/cargo-example.md +++ b/examples/cargo-example.md @@ -8,13 +8,13 @@ The help looks like: $ cargo-example --help cargo -USAGE: +Usage: cargo -OPTIONS: +Options: -h, --help Print help information -SUBCOMMANDS: +Subcommands: example A simple to use, efficient, and full-featured Command Line Argument Parser help Print this message or the help of the given subcommand(s) @@ -22,10 +22,10 @@ $ cargo-example example --help cargo-example [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: cargo example [OPTIONS] -OPTIONS: +Options: --manifest-path -h, --help Print help information -V, --version Print version information diff --git a/examples/demo.md b/examples/demo.md index 479bae100757..fa34e813a3e7 100644 --- a/examples/demo.md +++ b/examples/demo.md @@ -3,10 +3,10 @@ $ demo --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: demo[EXE] [OPTIONS] --name -OPTIONS: +Options: -n, --name Name of the person to greet -c, --count Number of times to greet [default: 1] -h, --help Print help information diff --git a/examples/derive_ref/custom-bool.md b/examples/derive_ref/custom-bool.md index 2db5e3f7f3c8..f8a5bd86b207 100644 --- a/examples/derive_ref/custom-bool.md +++ b/examples/derive_ref/custom-bool.md @@ -7,13 +7,13 @@ $ custom-bool --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: custom-bool[EXE] [OPTIONS] --foo -ARGS: +Arguments: [possible values: true, false] -OPTIONS: +Options: --foo [possible values: true, false] --bar [default: false] -h, --help Print help information @@ -25,7 +25,7 @@ error: The following required arguments were not provided: --foo -USAGE: +Usage: custom-bool[EXE] [OPTIONS] --foo For more information try --help diff --git a/examples/derive_ref/interop_tests.md b/examples/derive_ref/interop_tests.md index 8a1fd6e4250b..ee3faceea76c 100644 --- a/examples/derive_ref/interop_tests.md +++ b/examples/derive_ref/interop_tests.md @@ -39,7 +39,7 @@ error: Found argument '--unknown' which wasn't expected, or isn't valid in this If you tried to supply `--unknown` as a value rather than a flag, use `-- --unknown` -USAGE: +Usage: interop_augment_args[EXE] [OPTIONS] For more information try --help @@ -77,7 +77,7 @@ error: Found argument '--unknown' which wasn't expected, or isn't valid in this If you tried to supply `--unknown` as a value rather than a flag, use `-- --unknown` -USAGE: +Usage: interop_augment_subcommands[EXE] derived [OPTIONS] For more information try --help @@ -89,7 +89,7 @@ $ interop_augment_subcommands unknown ? failed error: Found argument 'unknown' which wasn't expected, or isn't valid in this context -USAGE: +Usage: interop_augment_subcommands[EXE] [SUBCOMMAND] For more information try --help @@ -103,14 +103,14 @@ $ interop_hand_subcommand ? failed clap -USAGE: +Usage: interop_hand_subcommand[EXE] [OPTIONS] -OPTIONS: +Options: -t, --top-level -h, --help Print help information -SUBCOMMANDS: +Subcommands: add remove help Print this message or the help of the given subcommand(s) @@ -154,7 +154,7 @@ error: Found argument '--unknown' which wasn't expected, or isn't valid in this If you tried to supply `--unknown` as a value rather than a flag, use `-- --unknown` -USAGE: +Usage: interop_hand_subcommand[EXE] add [NAME]... For more information try --help @@ -198,7 +198,7 @@ $ interop_hand_subcommand unknown ? failed error: Found argument 'unknown' which wasn't expected, or isn't valid in this context -USAGE: +Usage: interop_hand_subcommand[EXE] [OPTIONS] For more information try --help @@ -255,7 +255,7 @@ error: Found argument '--unknown' which wasn't expected, or isn't valid in this If you tried to supply `--unknown` as a value rather than a flag, use `-- --unknown` -USAGE: +Usage: interop_flatten_hand_args[EXE] [OPTIONS] For more information try --help diff --git a/examples/escaped-positional-derive.md b/examples/escaped-positional-derive.md index a9c0dfaecd97..a6605b2a9c2b 100644 --- a/examples/escaped-positional-derive.md +++ b/examples/escaped-positional-derive.md @@ -8,13 +8,13 @@ $ escaped-positional-derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: escaped-positional-derive[EXE] [OPTIONS] [-- ...] -ARGS: +Arguments: ... -OPTIONS: +Options: -f -p -h, --help Print help information @@ -37,7 +37,7 @@ $ escaped-positional-derive foo bar ? failed error: Found argument 'foo' which wasn't expected, or isn't valid in this context -USAGE: +Usage: escaped-positional-derive[EXE] [OPTIONS] [-- ...] For more information try --help diff --git a/examples/escaped-positional.md b/examples/escaped-positional.md index 68c1be64efee..ffc7ca3fea3c 100644 --- a/examples/escaped-positional.md +++ b/examples/escaped-positional.md @@ -8,13 +8,13 @@ $ escaped-positional --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: escaped-positional[EXE] [OPTIONS] [-- ...] -ARGS: +Arguments: ... -OPTIONS: +Options: -f -p -h, --help Print help information @@ -37,7 +37,7 @@ $ escaped-positional foo bar ? failed error: Found argument 'foo' which wasn't expected, or isn't valid in this context -USAGE: +Usage: escaped-positional[EXE] [OPTIONS] [-- ...] For more information try --help diff --git a/examples/find.md b/examples/find.md index decfa2abce23..8db97af2acc4 100644 --- a/examples/find.md +++ b/examples/find.md @@ -5,10 +5,10 @@ $ find --help clap 4.0.0-alpha.0 A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: find[EXE] [OPTIONS] --name -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/git-derive.md b/examples/git-derive.md index ad79b7c80525..248254a0d60f 100644 --- a/examples/git-derive.md +++ b/examples/git-derive.md @@ -9,13 +9,13 @@ $ git-derive git A fictional versioning CLI -USAGE: +Usage: git-derive[EXE] -OPTIONS: +Options: -h, --help Print help information -SUBCOMMANDS: +Subcommands: clone Clones repos push pushes things add adds things @@ -26,13 +26,13 @@ $ git-derive help git A fictional versioning CLI -USAGE: +Usage: git-derive[EXE] -OPTIONS: +Options: -h, --help Print help information -SUBCOMMANDS: +Subcommands: clone Clones repos push pushes things add adds things @@ -43,13 +43,13 @@ $ git-derive help add git-add adds things -USAGE: +Usage: git-derive[EXE] add ... -ARGS: +Arguments: ... Stuff to add -OPTIONS: +Options: -h, --help Print help information ``` @@ -61,13 +61,13 @@ $ git-derive add git-add adds things -USAGE: +Usage: git-derive[EXE] add ... -ARGS: +Arguments: ... Stuff to add -OPTIONS: +Options: -h, --help Print help information $ git-derive add Cargo.toml Cargo.lock @@ -80,15 +80,15 @@ Default subcommand: $ git-derive stash -h git-stash -USAGE: +Usage: git-derive[EXE] stash [OPTIONS] git-derive[EXE] stash -OPTIONS: +Options: -m, --message -h, --help Print help information -SUBCOMMANDS: +Subcommands: push pop apply @@ -97,23 +97,23 @@ SUBCOMMANDS: $ git-derive stash push -h git-stash-push -USAGE: +Usage: git-derive[EXE] stash push [OPTIONS] -OPTIONS: +Options: -m, --message -h, --help Print help information $ git-derive stash pop -h git-stash-pop -USAGE: +Usage: git-derive[EXE] stash pop [STASH] -ARGS: +Arguments: -OPTIONS: +Options: -h, --help Print help information $ git-derive stash -m "Prototype" diff --git a/examples/git.md b/examples/git.md index c69e499294b2..24cd41dec59e 100644 --- a/examples/git.md +++ b/examples/git.md @@ -7,13 +7,13 @@ $ git git A fictional versioning CLI -USAGE: +Usage: git[EXE] -OPTIONS: +Options: -h, --help Print help information -SUBCOMMANDS: +Subcommands: clone Clones repos push pushes things add adds things @@ -24,13 +24,13 @@ $ git help git A fictional versioning CLI -USAGE: +Usage: git[EXE] -OPTIONS: +Options: -h, --help Print help information -SUBCOMMANDS: +Subcommands: clone Clones repos push pushes things add adds things @@ -41,13 +41,13 @@ $ git help add git-add adds things -USAGE: +Usage: git[EXE] add ... -ARGS: +Arguments: ... Stuff to add -OPTIONS: +Options: -h, --help Print help information ``` @@ -59,13 +59,13 @@ $ git add git-add adds things -USAGE: +Usage: git[EXE] add ... -ARGS: +Arguments: ... Stuff to add -OPTIONS: +Options: -h, --help Print help information $ git add Cargo.toml Cargo.lock @@ -78,15 +78,15 @@ Default subcommand: $ git stash -h git-stash -USAGE: +Usage: git[EXE] stash [OPTIONS] git[EXE] stash -OPTIONS: +Options: -m, --message -h, --help Print help information -SUBCOMMANDS: +Subcommands: push pop apply @@ -95,23 +95,23 @@ SUBCOMMANDS: $ git stash push -h git-stash-push -USAGE: +Usage: git[EXE] stash push [OPTIONS] -OPTIONS: +Options: -m, --message -h, --help Print help information $ git stash pop -h git-stash-pop -USAGE: +Usage: git[EXE] stash pop [STASH] -ARGS: +Arguments: -OPTIONS: +Options: -h, --help Print help information $ git stash -m "Prototype" diff --git a/examples/multicall-busybox.md b/examples/multicall-busybox.md index 3ffc6b85daea..9140edea7e89 100644 --- a/examples/multicall-busybox.md +++ b/examples/multicall-busybox.md @@ -27,10 +27,10 @@ $ busybox ? failed busybox -USAGE: +Usage: busybox [OPTIONS] [APPLET] -OPTIONS: +Options: --install Install hardlinks for all subcommands in path -h, --help Print help information diff --git a/examples/pacman.md b/examples/pacman.md index 41ba4946a5dc..81653e14987d 100644 --- a/examples/pacman.md +++ b/examples/pacman.md @@ -39,14 +39,14 @@ pacman 5.2.1 Pacman Development Team package manager utility -USAGE: +Usage: pacman[EXE] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information -SUBCOMMANDS: +Subcommands: query -Q --query Query the package database. sync -S --sync Synchronize packages. help Print this message or the help of the given subcommand(s) @@ -55,13 +55,13 @@ $ pacman -S -h pacman-sync Synchronize packages. -USAGE: +Usage: pacman[EXE] {sync|--sync|-S} [OPTIONS] [--] [package]... -ARGS: +Arguments: ... packages -OPTIONS: +Options: -s, --search ... search remote repositories for matching strings -i, --info view package information -h, --help Print help information @@ -74,7 +74,7 @@ $ pacman -S -s foo -i bar ? failed error: The argument '--search ...' cannot be used with '--info' -USAGE: +Usage: pacman[EXE] {sync|--sync|-S} --search ... ... For more information try --help diff --git a/examples/tutorial_builder/01_quick.md b/examples/tutorial_builder/01_quick.md index a110e8f977d2..74b83d76b4af 100644 --- a/examples/tutorial_builder/01_quick.md +++ b/examples/tutorial_builder/01_quick.md @@ -3,19 +3,19 @@ $ 01_quick --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 01_quick[EXE] [OPTIONS] [name] [SUBCOMMAND] -ARGS: +Arguments: Optional name to operate on -OPTIONS: +Options: -c, --config Sets a custom config file -d, --debug... Turn debugging information on -h, --help Print help information -V, --version Print version information -SUBCOMMANDS: +Subcommands: test does testing things help Print this message or the help of the given subcommand(s) diff --git a/examples/tutorial_builder/02_app_settings.md b/examples/tutorial_builder/02_app_settings.md index 247843bcfdcb..2be9b9f304a1 100644 --- a/examples/tutorial_builder/02_app_settings.md +++ b/examples/tutorial_builder/02_app_settings.md @@ -3,10 +3,10 @@ $ 02_app_settings --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 02_app_settings[EXE] --two --one -OPTIONS: +Options: --two --one -h, --help Print help information diff --git a/examples/tutorial_builder/02_apps.md b/examples/tutorial_builder/02_apps.md index 9338f493791b..a1302ef880b7 100644 --- a/examples/tutorial_builder/02_apps.md +++ b/examples/tutorial_builder/02_apps.md @@ -4,10 +4,10 @@ MyApp 1.0 Kevin K. Does awesome things -USAGE: +Usage: 02_apps[EXE] --two --one -OPTIONS: +Options: --two --one -h, --help Print help information diff --git a/examples/tutorial_builder/02_crate.md b/examples/tutorial_builder/02_crate.md index 80b14766fb69..864a4f5303c3 100644 --- a/examples/tutorial_builder/02_crate.md +++ b/examples/tutorial_builder/02_crate.md @@ -3,10 +3,10 @@ $ 02_crate --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 02_crate[EXE] --two --one -OPTIONS: +Options: --two --one -h, --help Print help information diff --git a/examples/tutorial_builder/03_01_flag_bool.md b/examples/tutorial_builder/03_01_flag_bool.md index b7255b37ff08..47e2efe1e0e1 100644 --- a/examples/tutorial_builder/03_01_flag_bool.md +++ b/examples/tutorial_builder/03_01_flag_bool.md @@ -3,10 +3,10 @@ $ 03_01_flag_bool --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_01_flag_bool[EXE] [OPTIONS] -OPTIONS: +Options: -v, --verbose -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/03_01_flag_count.md b/examples/tutorial_builder/03_01_flag_count.md index 34be02f10ca1..939a0b3a2b99 100644 --- a/examples/tutorial_builder/03_01_flag_count.md +++ b/examples/tutorial_builder/03_01_flag_count.md @@ -3,10 +3,10 @@ $ 03_01_flag_count --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_01_flag_count[EXE] [OPTIONS] -OPTIONS: +Options: -v, --verbose... -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/03_02_option.md b/examples/tutorial_builder/03_02_option.md index 3ee06eb78058..8e69db58747f 100644 --- a/examples/tutorial_builder/03_02_option.md +++ b/examples/tutorial_builder/03_02_option.md @@ -3,10 +3,10 @@ $ 03_02_option --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_02_option[EXE] [OPTIONS] -OPTIONS: +Options: -n, --name -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/03_02_option_mult.md b/examples/tutorial_builder/03_02_option_mult.md index 582f5c9dabaf..f1c7234bff65 100644 --- a/examples/tutorial_builder/03_02_option_mult.md +++ b/examples/tutorial_builder/03_02_option_mult.md @@ -3,10 +3,10 @@ $ 03_02_option_mult --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_02_option_mult[EXE] [OPTIONS] -OPTIONS: +Options: -n, --name -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/03_03_positional.md b/examples/tutorial_builder/03_03_positional.md index 63eab23c95c2..e5f543ad7ccb 100644 --- a/examples/tutorial_builder/03_03_positional.md +++ b/examples/tutorial_builder/03_03_positional.md @@ -3,13 +3,13 @@ $ 03_03_positional --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_03_positional[EXE] [name] -ARGS: +Arguments: -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/03_03_positional_mult.md b/examples/tutorial_builder/03_03_positional_mult.md index 13d100278964..e030d3706fd1 100644 --- a/examples/tutorial_builder/03_03_positional_mult.md +++ b/examples/tutorial_builder/03_03_positional_mult.md @@ -3,13 +3,13 @@ $ 03_03_positional_mult --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_03_positional_mult[EXE] [name]... -ARGS: +Arguments: ... -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/03_04_subcommands.md b/examples/tutorial_builder/03_04_subcommands.md index d52afdfdabc5..30f0318a3883 100644 --- a/examples/tutorial_builder/03_04_subcommands.md +++ b/examples/tutorial_builder/03_04_subcommands.md @@ -3,14 +3,14 @@ $ 03_04_subcommands help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_04_subcommands[EXE] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information -SUBCOMMANDS: +Subcommands: add Adds files to myapp help Print this message or the help of the given subcommand(s) @@ -18,13 +18,13 @@ $ 03_04_subcommands help add clap-add [..] Adds files to myapp -USAGE: +Usage: 03_04_subcommands[EXE] add [NAME] -ARGS: +Arguments: -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information @@ -40,14 +40,14 @@ $ 03_04_subcommands clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_04_subcommands[EXE] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information -SUBCOMMANDS: +Subcommands: add Adds files to myapp help Print this message or the help of the given subcommand(s) diff --git a/examples/tutorial_builder/03_05_default_values.md b/examples/tutorial_builder/03_05_default_values.md index 95465bf7d531..8ef13d807664 100644 --- a/examples/tutorial_builder/03_05_default_values.md +++ b/examples/tutorial_builder/03_05_default_values.md @@ -3,13 +3,13 @@ $ 03_05_default_values --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_05_default_values[EXE] [NAME] -ARGS: +Arguments: [default: alice] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/04_01_enum.md b/examples/tutorial_builder/04_01_enum.md index 282b1e613443..697924360416 100644 --- a/examples/tutorial_builder/04_01_enum.md +++ b/examples/tutorial_builder/04_01_enum.md @@ -3,13 +3,13 @@ $ 04_01_enum --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_01_enum[EXE] -ARGS: +Arguments: What mode to run the program in [possible values: fast, slow] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/04_01_possible.md b/examples/tutorial_builder/04_01_possible.md index 2909bfb17e0b..2e1e86c2ac01 100644 --- a/examples/tutorial_builder/04_01_possible.md +++ b/examples/tutorial_builder/04_01_possible.md @@ -3,13 +3,13 @@ $ 04_01_possible --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_01_possible[EXE] -ARGS: +Arguments: What mode to run the program in [possible values: fast, slow] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/04_02_parse.md b/examples/tutorial_builder/04_02_parse.md index 605bf4b5920a..5f4de3840bb4 100644 --- a/examples/tutorial_builder/04_02_parse.md +++ b/examples/tutorial_builder/04_02_parse.md @@ -3,13 +3,13 @@ $ 04_02_parse --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_02_parse[EXE] -ARGS: +Arguments: Network port to use -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/04_02_validate.md b/examples/tutorial_builder/04_02_validate.md index a317a8eb76c2..3f0ce42e56b1 100644 --- a/examples/tutorial_builder/04_02_validate.md +++ b/examples/tutorial_builder/04_02_validate.md @@ -3,13 +3,13 @@ $ 04_02_validate --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_02_validate[EXE] -ARGS: +Arguments: Network port to use -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_builder/04_03_relations.md b/examples/tutorial_builder/04_03_relations.md index 86522313b693..a6978a202197 100644 --- a/examples/tutorial_builder/04_03_relations.md +++ b/examples/tutorial_builder/04_03_relations.md @@ -3,13 +3,13 @@ $ 04_03_relations --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_03_relations[EXE] [OPTIONS] <--set-ver |--major|--minor|--patch> [INPUT_FILE] -ARGS: +Arguments: some regular input -OPTIONS: +Options: --set-ver set version manually --major auto inc major --minor auto inc minor @@ -24,7 +24,7 @@ $ 04_03_relations error: The following required arguments were not provided: <--set-ver |--major|--minor|--patch> -USAGE: +Usage: 04_03_relations[EXE] [OPTIONS] <--set-ver |--major|--minor|--patch> [INPUT_FILE] For more information try --help @@ -36,7 +36,7 @@ $ 04_03_relations --major --minor ? failed error: The argument '--major' cannot be used with '--minor' -USAGE: +Usage: 04_03_relations[EXE] <--set-ver |--major|--minor|--patch> For more information try --help @@ -46,7 +46,7 @@ $ 04_03_relations --major -c config.toml error: The following required arguments were not provided: > -USAGE: +Usage: 04_03_relations[EXE] -c <--set-ver |--major|--minor|--patch> > For more information try --help diff --git a/examples/tutorial_builder/04_04_custom.md b/examples/tutorial_builder/04_04_custom.md index 7bd7d626fa21..ff14837fedf0 100644 --- a/examples/tutorial_builder/04_04_custom.md +++ b/examples/tutorial_builder/04_04_custom.md @@ -3,13 +3,13 @@ $ 04_04_custom --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] -ARGS: +Arguments: some regular input -OPTIONS: +Options: --set-ver set version manually --major auto inc major --minor auto inc minor @@ -23,7 +23,7 @@ $ 04_04_custom ? failed error: Can only modify one version field -USAGE: +Usage: 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] For more information try --help @@ -35,7 +35,7 @@ $ 04_04_custom --major --minor ? failed error: Can only modify one version field -USAGE: +Usage: 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] For more information try --help @@ -45,7 +45,7 @@ $ 04_04_custom --major -c config.toml Version: 2.2.3 error: INPUT_FILE or --spec-in is required when using --config -USAGE: +Usage: 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] For more information try --help diff --git a/examples/tutorial_derive/01_quick.md b/examples/tutorial_derive/01_quick.md index 6328f9702fa1..1e58db5f3cb4 100644 --- a/examples/tutorial_derive/01_quick.md +++ b/examples/tutorial_derive/01_quick.md @@ -3,19 +3,19 @@ $ 01_quick_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 01_quick_derive[EXE] [OPTIONS] [NAME] [SUBCOMMAND] -ARGS: +Arguments: Optional name to operate on -OPTIONS: +Options: -c, --config Sets a custom config file -d, --debug... Turn debugging information on -h, --help Print help information -V, --version Print version information -SUBCOMMANDS: +Subcommands: test does testing things help Print this message or the help of the given subcommand(s) diff --git a/examples/tutorial_derive/02_app_settings.md b/examples/tutorial_derive/02_app_settings.md index ee16c66df7cf..feb31b9cd0e1 100644 --- a/examples/tutorial_derive/02_app_settings.md +++ b/examples/tutorial_derive/02_app_settings.md @@ -3,10 +3,10 @@ $ 02_app_settings_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 02_app_settings_derive[EXE] --two --one -OPTIONS: +Options: --two --one -h, --help Print help information diff --git a/examples/tutorial_derive/02_apps.md b/examples/tutorial_derive/02_apps.md index 59ea5b9e0974..7dbbd9641bd4 100644 --- a/examples/tutorial_derive/02_apps.md +++ b/examples/tutorial_derive/02_apps.md @@ -4,10 +4,10 @@ MyApp 1.0 Kevin K. Does awesome things -USAGE: +Usage: 02_apps_derive[EXE] --two --one -OPTIONS: +Options: --two --one -h, --help Print help information diff --git a/examples/tutorial_derive/02_crate.md b/examples/tutorial_derive/02_crate.md index ed89e94a8493..e883dea28d83 100644 --- a/examples/tutorial_derive/02_crate.md +++ b/examples/tutorial_derive/02_crate.md @@ -3,10 +3,10 @@ $ 02_crate_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 02_crate_derive[EXE] --two --one -OPTIONS: +Options: --two --one -h, --help Print help information diff --git a/examples/tutorial_derive/03_01_flag_bool.md b/examples/tutorial_derive/03_01_flag_bool.md index 5c5fb4150989..ddb7b7615ec8 100644 --- a/examples/tutorial_derive/03_01_flag_bool.md +++ b/examples/tutorial_derive/03_01_flag_bool.md @@ -3,10 +3,10 @@ $ 03_01_flag_bool_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_01_flag_bool_derive[EXE] [OPTIONS] -OPTIONS: +Options: -v, --verbose -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_derive/03_01_flag_count.md b/examples/tutorial_derive/03_01_flag_count.md index c0686254fdb1..a91724b8cd36 100644 --- a/examples/tutorial_derive/03_01_flag_count.md +++ b/examples/tutorial_derive/03_01_flag_count.md @@ -3,10 +3,10 @@ $ 03_01_flag_count_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_01_flag_count_derive[EXE] [OPTIONS] -OPTIONS: +Options: -v, --verbose... -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_derive/03_02_option.md b/examples/tutorial_derive/03_02_option.md index 4e8846de906e..5673345f85af 100644 --- a/examples/tutorial_derive/03_02_option.md +++ b/examples/tutorial_derive/03_02_option.md @@ -3,10 +3,10 @@ $ 03_02_option_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_02_option_derive[EXE] [OPTIONS] -OPTIONS: +Options: -n, --name -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_derive/03_02_option_mult.md b/examples/tutorial_derive/03_02_option_mult.md index f6d380872375..16190d1d815d 100644 --- a/examples/tutorial_derive/03_02_option_mult.md +++ b/examples/tutorial_derive/03_02_option_mult.md @@ -3,10 +3,10 @@ $ 03_02_option_mult_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_02_option_mult_derive[EXE] [OPTIONS] -OPTIONS: +Options: -n, --name -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_derive/03_03_positional.md b/examples/tutorial_derive/03_03_positional.md index 7281fe3ffe87..9f2fcfd52c14 100644 --- a/examples/tutorial_derive/03_03_positional.md +++ b/examples/tutorial_derive/03_03_positional.md @@ -3,13 +3,13 @@ $ 03_03_positional_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_03_positional_derive[EXE] [NAME] -ARGS: +Arguments: -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_derive/03_03_positional_mult.md b/examples/tutorial_derive/03_03_positional_mult.md index 521e8b598b06..3c45f4746917 100644 --- a/examples/tutorial_derive/03_03_positional_mult.md +++ b/examples/tutorial_derive/03_03_positional_mult.md @@ -3,13 +3,13 @@ $ 03_03_positional_mult_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_03_positional_mult_derive[EXE] [NAME]... -ARGS: +Arguments: ... -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_derive/03_04_subcommands.md b/examples/tutorial_derive/03_04_subcommands.md index ed4dc8b6b099..ec264223f7ff 100644 --- a/examples/tutorial_derive/03_04_subcommands.md +++ b/examples/tutorial_derive/03_04_subcommands.md @@ -3,14 +3,14 @@ $ 03_04_subcommands_derive help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_04_subcommands_derive[EXE] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information -SUBCOMMANDS: +Subcommands: add Adds files to myapp help Print this message or the help of the given subcommand(s) @@ -18,13 +18,13 @@ $ 03_04_subcommands_derive help add clap-add [..] Adds files to myapp -USAGE: +Usage: 03_04_subcommands_derive[EXE] add [NAME] -ARGS: +Arguments: -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information @@ -40,14 +40,14 @@ $ 03_04_subcommands_derive clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_04_subcommands_derive[EXE] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information -SUBCOMMANDS: +Subcommands: add Adds files to myapp help Print this message or the help of the given subcommand(s) diff --git a/examples/tutorial_derive/03_05_default_values.md b/examples/tutorial_derive/03_05_default_values.md index f7315e7362d6..d5c3c541e0a0 100644 --- a/examples/tutorial_derive/03_05_default_values.md +++ b/examples/tutorial_derive/03_05_default_values.md @@ -3,13 +3,13 @@ $ 03_05_default_values_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 03_05_default_values_derive[EXE] [NAME] -ARGS: +Arguments: [default: alice] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_derive/04_01_enum.md b/examples/tutorial_derive/04_01_enum.md index 2523af924a6d..eb6de3db5bbc 100644 --- a/examples/tutorial_derive/04_01_enum.md +++ b/examples/tutorial_derive/04_01_enum.md @@ -3,13 +3,13 @@ $ 04_01_enum_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_01_enum_derive[EXE] -ARGS: +Arguments: What mode to run the program in [possible values: fast, slow] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_derive/04_02_parse.md b/examples/tutorial_derive/04_02_parse.md index 6079ef193722..15af7c011bc4 100644 --- a/examples/tutorial_derive/04_02_parse.md +++ b/examples/tutorial_derive/04_02_parse.md @@ -3,13 +3,13 @@ $ 04_02_parse_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_02_parse_derive[EXE] -ARGS: +Arguments: Network port to use -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_derive/04_02_validate.md b/examples/tutorial_derive/04_02_validate.md index cc43440efa39..c174b61d1d66 100644 --- a/examples/tutorial_derive/04_02_validate.md +++ b/examples/tutorial_derive/04_02_validate.md @@ -3,13 +3,13 @@ $ 04_02_validate_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_02_validate_derive[EXE] -ARGS: +Arguments: Network port to use -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information diff --git a/examples/tutorial_derive/04_03_relations.md b/examples/tutorial_derive/04_03_relations.md index 7b9f34304aca..12f5978a3a20 100644 --- a/examples/tutorial_derive/04_03_relations.md +++ b/examples/tutorial_derive/04_03_relations.md @@ -3,13 +3,13 @@ $ 04_03_relations_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_03_relations_derive[EXE] [OPTIONS] <--set-ver |--major|--minor|--patch> [INPUT_FILE] -ARGS: +Arguments: some regular input -OPTIONS: +Options: --set-ver set version manually --major auto inc major --minor auto inc minor @@ -24,7 +24,7 @@ $ 04_03_relations_derive error: The following required arguments were not provided: <--set-ver |--major|--minor|--patch> -USAGE: +Usage: 04_03_relations_derive[EXE] [OPTIONS] <--set-ver |--major|--minor|--patch> [INPUT_FILE] For more information try --help @@ -36,7 +36,7 @@ $ 04_03_relations_derive --major --minor ? failed error: The argument '--major' cannot be used with '--minor' -USAGE: +Usage: 04_03_relations_derive[EXE] <--set-ver |--major|--minor|--patch> For more information try --help @@ -46,7 +46,7 @@ $ 04_03_relations_derive --major -c config.toml error: The following required arguments were not provided: > -USAGE: +Usage: 04_03_relations_derive[EXE] -c <--set-ver |--major|--minor|--patch> > For more information try --help diff --git a/examples/tutorial_derive/04_04_custom.md b/examples/tutorial_derive/04_04_custom.md index d935e5ab3a69..4a191d61ee68 100644 --- a/examples/tutorial_derive/04_04_custom.md +++ b/examples/tutorial_derive/04_04_custom.md @@ -3,13 +3,13 @@ $ 04_04_custom_derive --help clap [..] A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: 04_04_custom_derive[EXE] [OPTIONS] [INPUT_FILE] -ARGS: +Arguments: some regular input -OPTIONS: +Options: --set-ver set version manually --major auto inc major --minor auto inc minor @@ -23,7 +23,7 @@ $ 04_04_custom_derive ? failed error: Can only modify one version field -USAGE: +Usage: clap [OPTIONS] [INPUT_FILE] For more information try --help @@ -35,7 +35,7 @@ $ 04_04_custom_derive --major --minor ? failed error: Can only modify one version field -USAGE: +Usage: clap [OPTIONS] [INPUT_FILE] For more information try --help @@ -45,7 +45,7 @@ $ 04_04_custom_derive --major -c config.toml Version: 2.2.3 error: INPUT_FILE or --spec-in is required when using --config -USAGE: +Usage: clap [OPTIONS] [INPUT_FILE] For more information try --help diff --git a/examples/typed-derive.md b/examples/typed-derive.md index 20eb6b6bcea9..ab6587fe28e5 100644 --- a/examples/typed-derive.md +++ b/examples/typed-derive.md @@ -5,10 +5,10 @@ Help: $ typed-derive --help clap -USAGE: +Usage: typed-derive[EXE] [OPTIONS] -OPTIONS: +Options: -O Implicitly using `std::str::FromStr` -I Allow invalid UTF-8 paths --bind Handle IP addresses diff --git a/src/output/help.rs b/src/output/help.rs index 786db8db6ac5..f7a7f2ded78d 100644 --- a/src/output/help.rs +++ b/src/output/help.rs @@ -155,7 +155,7 @@ impl<'cmd, 'writer> Help<'cmd, 'writer> { self.write_about(true, true); } "usage-heading" => { - self.header("USAGE:"); + self.header("Usage:"); } "usage" => { self.writer @@ -340,8 +340,8 @@ impl<'cmd, 'writer> Help<'cmd, 'writer> { let mut first = if !pos.is_empty() { // Write positional args if any - self.header("ARGS:\n"); - self.write_args(&pos, "ARGS", positional_sort_key); + self.header("Arguments:\n"); + self.write_args(&pos, "Arguments", positional_sort_key); false } else { true @@ -351,8 +351,8 @@ impl<'cmd, 'writer> Help<'cmd, 'writer> { if !first { self.none("\n\n"); } - self.header("OPTIONS:\n"); - self.write_args(&non_pos, "OPTIONS", option_sort_key); + self.header("Options:\n"); + self.write_args(&non_pos, "Options", option_sort_key); first = false; } if !custom_headings.is_empty() { @@ -385,7 +385,7 @@ impl<'cmd, 'writer> Help<'cmd, 'writer> { self.none("\n\n"); } - let default_help_heading = Str::from("SUBCOMMANDS"); + let default_help_heading = Str::from("Subcommands"); self.header( self.cmd .get_subcommand_help_heading() diff --git a/src/output/usage.rs b/src/output/usage.rs index 38ecc508220a..fdcf65d28690 100644 --- a/src/output/usage.rs +++ b/src/output/usage.rs @@ -32,7 +32,7 @@ impl<'cmd> Usage<'cmd> { pub(crate) fn create_usage_with_title(&self, used: &[Id]) -> StyledStr { debug!("Usage::create_usage_with_title"); let mut styled = StyledStr::new(); - styled.header("USAGE:"); + styled.header("Usage:"); styled.none("\n "); styled.extend(self.create_usage_no_title(used).into_iter()); styled diff --git a/tests/builder/app_settings.rs b/tests/builder/app_settings.rs index abc43194a95c..b8f46022a88e 100644 --- a/tests/builder/app_settings.rs +++ b/tests/builder/app_settings.rs @@ -6,25 +6,25 @@ use clap::{arg, error::ErrorKind, Arg, ArgAction, Command}; static ALLOW_EXT_SC: &str = "clap-test v1.4.8 -USAGE: +Usage: clap-test [SUBCOMMAND] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information "; static DONT_COLLAPSE_ARGS: &str = "clap-test v1.4.8 -USAGE: +Usage: clap-test [arg1] [arg2] [arg3] -ARGS: +Arguments: some some some -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information "; @@ -127,10 +127,10 @@ fn arg_required_else_help_with_default() { fn arg_required_else_help_error_message() { static ARG_REQUIRED_ELSE_HELP: &str = "test 1.0 -USAGE: +Usage: test [OPTIONS] -OPTIONS: +Options: -i, --info Provides more info -h, --help Print help information -V, --version Print version information @@ -288,13 +288,13 @@ fn skip_possible_values() { Kevin K. tests stuff -USAGE: +Usage: test [OPTIONS] [arg1] -ARGS: +Arguments: some pos arg -OPTIONS: +Options: -o, --opt some option -h, --help Print help information -V, --version Print version information @@ -567,10 +567,10 @@ fn dont_collapse_args() { fn require_eq() { static REQUIRE_EQUALS: &str = "clap-test v1.4.8 -USAGE: +Usage: clap-test --opt= -OPTIONS: +Options: -o, --opt= some -h, --help Print help information -V, --version Print version information diff --git a/tests/builder/arg_aliases.rs b/tests/builder/arg_aliases.rs index 9529ee72dc19..15eea497f3b3 100644 --- a/tests/builder/arg_aliases.rs +++ b/tests/builder/arg_aliases.rs @@ -193,10 +193,10 @@ fn invisible_arg_aliases_help_output() { static SC_INVISIBLE_ALIAS_HELP: &str = "ct-test 1.2 Some help -USAGE: +Usage: ct test [OPTIONS] -OPTIONS: +Options: -o, --opt -f, --flag -h, --help Print help information @@ -224,10 +224,10 @@ fn visible_arg_aliases_help_output() { static SC_VISIBLE_ALIAS_HELP: &str = "ct-test 1.2 Some help -USAGE: +Usage: ct test [OPTIONS] -OPTIONS: +Options: -o, --opt [aliases: visible] -f, --flag [aliases: v_flg, flag2, flg3] -h, --help Print help information diff --git a/tests/builder/arg_aliases_short.rs b/tests/builder/arg_aliases_short.rs index 1dd6892722d3..e02792bfa2b9 100644 --- a/tests/builder/arg_aliases_short.rs +++ b/tests/builder/arg_aliases_short.rs @@ -160,10 +160,10 @@ fn invisible_short_arg_aliases_help_output() { static SC_INVISIBLE_ALIAS_HELP: &str = "ct-test 1.2 Some help -USAGE: +Usage: ct test [OPTIONS] -OPTIONS: +Options: -o, --opt -f, --flag -h, --help Print help information @@ -191,10 +191,10 @@ fn visible_short_arg_aliases_help_output() { static SC_VISIBLE_ALIAS_HELP: &str = "ct-test 1.2 Some help -USAGE: +Usage: ct test [OPTIONS] -OPTIONS: +Options: -o, --opt [short aliases: v] -f, --flag [aliases: flag1] [short aliases: a, b, 🦆] -h, --help Print help information diff --git a/tests/builder/cargo.rs b/tests/builder/cargo.rs index d2eb6822fa64..a875dfab32bd 100644 --- a/tests/builder/cargo.rs +++ b/tests/builder/cargo.rs @@ -7,10 +7,10 @@ use clap::{ static DESCRIPTION_ONLY: &str = "prog 1 A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: prog -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information "; @@ -18,10 +18,10 @@ OPTIONS: static AUTHORS_ONLY: &str = "prog 1 -USAGE: +Usage: prog -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information "; diff --git a/tests/builder/command.rs b/tests/builder/command.rs index 9f31d7a9d6a1..49540b966b38 100644 --- a/tests/builder/command.rs +++ b/tests/builder/command.rs @@ -5,10 +5,10 @@ use clap::{command, error::ErrorKind}; static EVERYTHING: &str = "clap {{version}} A simple to use, efficient, and full-featured Command Line Argument Parser -USAGE: +Usage: clap -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information "; diff --git a/tests/builder/conflicts.rs b/tests/builder/conflicts.rs index 22cee6f3eaea..690a51995fa1 100644 --- a/tests/builder/conflicts.rs +++ b/tests/builder/conflicts.rs @@ -292,7 +292,7 @@ fn get_arg_conflicts_with_group() { fn conflict_output() { static CONFLICT_ERR: &str = "error: The argument '--flag...' cannot be used with '-F' -USAGE: +Usage: clap-test --flag... --long-option-2 For more information try --help @@ -310,7 +310,7 @@ For more information try --help fn conflict_output_rev() { static CONFLICT_ERR_REV: &str = "error: The argument '-F' cannot be used with '--flag...' -USAGE: +Usage: clap-test -F --long-option-2 For more information try --help @@ -328,7 +328,7 @@ For more information try --help fn conflict_output_with_required() { static CONFLICT_ERR: &str = "error: The argument '--flag...' cannot be used with '-F' -USAGE: +Usage: clap-test --flag... --long-option-2 For more information try --help @@ -346,7 +346,7 @@ For more information try --help fn conflict_output_rev_with_required() { static CONFLICT_ERR_REV: &str = "error: The argument '-F' cannot be used with '--flag...' -USAGE: +Usage: clap-test -F --long-option-2 For more information try --help @@ -366,7 +366,7 @@ fn conflict_output_three_conflicting() { --two --three -USAGE: +Usage: three_conflicting_arguments --one For more information try --help diff --git a/tests/builder/default_vals.rs b/tests/builder/default_vals.rs index d2f2fc08a1d8..75b9ea581024 100644 --- a/tests/builder/default_vals.rs +++ b/tests/builder/default_vals.rs @@ -731,7 +731,7 @@ fn default_vals_donnot_show_in_smart_usage() { "error: The following required arguments were not provided: -USAGE: +Usage: bug [OPTIONS] For more information try --help diff --git a/tests/builder/derive_order.rs b/tests/builder/derive_order.rs index 480cd00c90c4..3c6180b55d95 100644 --- a/tests/builder/derive_order.rs +++ b/tests/builder/derive_order.rs @@ -8,10 +8,10 @@ use clap::{Arg, ArgAction, Command}; fn no_derive_order() { static NO_DERIVE_ORDER: &str = "test 1.2 -USAGE: +Usage: test [OPTIONS] -OPTIONS: +Options: --flag_a second flag --flag_b first flag -h, --help Print help information @@ -49,10 +49,10 @@ OPTIONS: fn derive_order() { static UNIFIED_HELP_AND_DERIVE: &str = "test 1.2 -USAGE: +Usage: test [OPTIONS] -OPTIONS: +Options: --flag_b first flag --option_b first option --flag_a second flag @@ -87,10 +87,10 @@ OPTIONS: fn derive_order_next_order() { static HELP: &str = "test 1.2 -USAGE: +Usage: test [OPTIONS] -OPTIONS: +Options: --flag_b first flag --option_b first option -h, --help Print help information @@ -135,10 +135,10 @@ OPTIONS: fn derive_order_no_next_order() { static HELP: &str = "test 1.2 -USAGE: +Usage: test [OPTIONS] -OPTIONS: +Options: --flag_a first flag --flag_b second flag -h, --help Print help information @@ -182,10 +182,10 @@ OPTIONS: fn derive_order_subcommand_propagate() { static UNIFIED_DERIVE_SC_PROP: &str = "test-sub 1.2 -USAGE: +Usage: test sub [OPTIONS] -OPTIONS: +Options: --flag_b first flag --option_b first option --flag_a second flag @@ -222,10 +222,10 @@ OPTIONS: fn derive_order_subcommand_propagate_with_explicit_display_order() { static UNIFIED_DERIVE_SC_PROP_EXPLICIT_ORDER: &str = "test-sub 1.2 -USAGE: +Usage: test sub [OPTIONS] -OPTIONS: +Options: --flag_a second flag --flag_b first flag --option_b first option @@ -268,14 +268,14 @@ OPTIONS: fn subcommand_sorted_display_order() { static SUBCMD_ALPHA_ORDER: &str = "test 1 -USAGE: +Usage: test [SUBCOMMAND] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information -SUBCOMMANDS: +Subcommands: a1 blah a1 b1 blah b1 help Print this message or the help of the given subcommand(s) @@ -305,14 +305,14 @@ SUBCOMMANDS: fn subcommand_derived_display_order() { static SUBCMD_DECL_ORDER: &str = "test 1 -USAGE: +Usage: test [SUBCOMMAND] -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information -SUBCOMMANDS: +Subcommands: b1 blah b1 a1 blah a1 help Print this message or the help of the given subcommand(s) diff --git a/tests/builder/display_order.rs b/tests/builder/display_order.rs index 139682d80e31..52b5fa10f652 100644 --- a/tests/builder/display_order.rs +++ b/tests/builder/display_order.rs @@ -11,13 +11,13 @@ fn very_large_display_order() { "test --help", "test -USAGE: +Usage: test [SUBCOMMAND] -OPTIONS: +Options: -h, --help Print help information -SUBCOMMANDS: +Subcommands: help Print this message or the help of the given subcommand(s) sub ", diff --git a/tests/builder/double_require.rs b/tests/builder/double_require.rs index b707540dd848..e5d364215671 100644 --- a/tests/builder/double_require.rs +++ b/tests/builder/double_require.rs @@ -2,10 +2,10 @@ use clap::{error::ErrorKind, Arg, ArgAction, Command}; static HELP: &str = "prog -USAGE: +Usage: prog [OPTIONS] -OPTIONS: +Options: -a -b -c @@ -15,7 +15,7 @@ OPTIONS: static ONLY_B_ERROR: &str = "error: The following required arguments were not provided: -c -USAGE: +Usage: prog -b -c For more information try --help @@ -24,7 +24,7 @@ For more information try --help static ONLY_C_ERROR: &str = "error: The following required arguments were not provided: -b -USAGE: +Usage: prog -c -b For more information try --help diff --git a/tests/builder/empty_values.rs b/tests/builder/empty_values.rs index da0596ab10b4..434f49762d1c 100644 --- a/tests/builder/empty_values.rs +++ b/tests/builder/empty_values.rs @@ -118,7 +118,7 @@ fn no_empty_values_without_equals_but_requires_equals() { static NO_EUQALS_ERROR: &str = "error: Equal sign is needed when assigning values to '--config='. -USAGE: +Usage: config [OPTIONS] For more information try --help diff --git a/tests/builder/error.rs b/tests/builder/error.rs index e2f95640458f..b0d77ba3ffa9 100644 --- a/tests/builder/error.rs +++ b/tests/builder/error.rs @@ -25,7 +25,7 @@ fn assert_error( fn app_error() { static MESSAGE: &str = "error: Failed for mysterious reasons -USAGE: +Usage: test [OPTIONS] --all For more information try --help @@ -91,10 +91,10 @@ fn null_prints_help() { static MESSAGE: &str = "\ test -USAGE: +Usage: test -OPTIONS: +Options: -h, --help Print help information "; assert_error(err, expected_kind, MESSAGE, false); @@ -112,10 +112,10 @@ fn raw_prints_help() { static MESSAGE: &str = "\ test -USAGE: +Usage: test -OPTIONS: +Options: -h, --help Print help information "; assert_error(err, expected_kind, MESSAGE, false); @@ -144,7 +144,7 @@ fn rich_formats_validation_error() { static MESSAGE: &str = "\ error: Found argument 'unused' which wasn't expected, or isn't valid in this context -USAGE: +Usage: test For more information try --help @@ -165,7 +165,7 @@ fn raw_formats_validation_error() { error: Found an argument which wasn't expected or isn't valid in this context Invalid Argument: unused -USAGE: +Usage: test "; assert_error(err, expected_kind, MESSAGE, true); diff --git a/tests/builder/flag_subcommands.rs b/tests/builder/flag_subcommands.rs index ff04f8763cce..56488d6749b2 100644 --- a/tests/builder/flag_subcommands.rs +++ b/tests/builder/flag_subcommands.rs @@ -499,10 +499,10 @@ fn flag_subcommand_long_infer_exact_match() { static FLAG_SUBCOMMAND_HELP: &str = "pacman-query Query the package database. -USAGE: +Usage: pacman {query|--query|-Q} [OPTIONS] -OPTIONS: +Options: -s, --search ... search locally installed packages for matching strings -i, --info ... view package information -h, --help Print help information @@ -548,10 +548,10 @@ fn flag_subcommand_long_short_normal_usage_string() { static FLAG_SUBCOMMAND_NO_SHORT_HELP: &str = "pacman-query Query the package database. -USAGE: +Usage: pacman {query|--query} [OPTIONS] -OPTIONS: +Options: -s, --search ... search locally installed packages for matching strings -i, --info ... view package information -h, --help Print help information @@ -601,10 +601,10 @@ fn flag_subcommand_long_normal_usage_string() { static FLAG_SUBCOMMAND_NO_LONG_HELP: &str = "pacman-query Query the package database. -USAGE: +Usage: pacman {query|-Q} [OPTIONS] -OPTIONS: +Options: -s, --search ... search locally installed packages for matching strings -i, --info ... view package information -h, --help Print help information diff --git a/tests/builder/flags.rs b/tests/builder/flags.rs index 43b5904acf38..3759446b7412 100644 --- a/tests/builder/flags.rs +++ b/tests/builder/flags.rs @@ -6,7 +6,7 @@ const USE_FLAG_AS_ARGUMENT: &str = \tIf you tried to supply `--another-flag` as a value rather than a flag, use `-- --another-flag` -USAGE: +Usage: mycat [OPTIONS] [filename] For more information try --help @@ -183,7 +183,7 @@ fn issue_2308_multiple_dashes() { If you tried to supply `-----` as a value rather than a flag, use `-- -----` -USAGE: +Usage: test For more information try --help diff --git a/tests/builder/groups.rs b/tests/builder/groups.rs index 84cbc4acbe2c..5187ceb57364 100644 --- a/tests/builder/groups.rs +++ b/tests/builder/groups.rs @@ -5,7 +5,7 @@ use clap::{arg, error::ErrorKind, Arg, ArgAction, ArgGroup, Command, Id}; static REQ_GROUP_USAGE: &str = "error: The following required arguments were not provided: -USAGE: +Usage: clap-test For more information try --help @@ -14,7 +14,7 @@ For more information try --help static REQ_GROUP_CONFLICT_USAGE: &str = "error: The argument '--delete' cannot be used with '' -USAGE: +Usage: clap-test For more information try --help @@ -23,7 +23,7 @@ For more information try --help static REQ_GROUP_CONFLICT_ONLY_OPTIONS: &str = "error: The argument '--delete' cannot be used with '--all' -USAGE: +Usage: clap-test <--all|--delete> For more information try --help @@ -263,13 +263,13 @@ fn group_overrides_required() { fn group_usage_use_val_name() { static GROUP_USAGE_USE_VAL_NAME: &str = "prog -USAGE: +Usage: prog -ARGS: +Arguments: -OPTIONS: +Options: -h, --help Print help information "; let cmd = Command::new("prog") diff --git a/tests/builder/help.rs b/tests/builder/help.rs index 11b8d30dd278..c43cd55d9f3a 100644 --- a/tests/builder/help.rs +++ b/tests/builder/help.rs @@ -78,7 +78,7 @@ fn help_multi_subcommand_error() { static EXPECTED: &str = "error: The subcommand 'foo' wasn't recognized -USAGE: +Usage: ctest subcmd multi [OPTIONS] For more information try --help @@ -90,14 +90,14 @@ For more information try --help fn req_last_arg_usage() { static LAST_ARG_REQ_MULT: &str = "example 1.0 -USAGE: +Usage: example ... [--] ... -ARGS: +Arguments: ... First ... Second -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information "; @@ -119,14 +119,14 @@ OPTIONS: fn args_with_last_usage() { static LAST_ARG_USAGE: &str = "flamegraph 0.1 -USAGE: +Usage: flamegraph [OPTIONS] [BINFILE] [-- ...] -ARGS: +Arguments: The path of the binary to be profiled. for a binary. ... Any arguments you wish to pass to the being profiled. -OPTIONS: +Options: -v, --verbose Prints out more stuff. -t, --timeout Timeout in seconds. -f, --frequency The sampling frequency. @@ -204,15 +204,15 @@ fn complex_help_output() { Kevin K. tests clap library -USAGE: +Usage: clap-test [OPTIONS] [ARGS] [SUBCOMMAND] -ARGS: +Arguments: tests positionals tests positionals with exclusions ... tests specific values [possible values: vi, emacs] -OPTIONS: +Options: -o, --option ... tests options -f, --flag... tests flags -F tests flags with exclusions @@ -227,7 +227,7 @@ OPTIONS: -h, --help Print help information -V, --version Print version information -SUBCOMMANDS: +Subcommands: subcmd tests subcommands help Print this message or the help of the given subcommand(s) "; @@ -242,10 +242,10 @@ fn after_and_before_help_output() { clap-test v1.4.8 tests clap library -USAGE: +Usage: clap-test -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information @@ -268,10 +268,10 @@ fn after_and_before_long_help_output() { clap-test v1.4.8 tests clap library -USAGE: +Usage: clap-test -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information @@ -283,10 +283,10 @@ some text that comes after the help clap-test v1.4.8 tests clap library -USAGE: +Usage: clap-test -OPTIONS: +Options: -h, --help Print help information @@ -311,10 +311,10 @@ static MULTI_SC_HELP: &str = "ctest-subcmd-multi 0.1 Kevin K. tests subcommands -USAGE: +Usage: ctest subcmd multi [OPTIONS] -OPTIONS: +Options: -f, --flag tests flags -o, --option ... tests options -h, --help Print help information @@ -357,10 +357,10 @@ fn no_wrap_help() { fn no_wrap_default_help() { static DEFAULT_HELP: &str = "ctest 1.0 -USAGE: +Usage: ctest -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information "; @@ -374,10 +374,10 @@ OPTIONS: fn wrapped_help() { static WRAPPED_HELP: &str = "test -USAGE: +Usage: test [OPTIONS] -OPTIONS: +Options: -a, --all Also do versioning for private crates (will not be published) @@ -430,10 +430,10 @@ OPTIONS: fn unwrapped_help() { static UNWRAPPED_HELP: &str = "test -USAGE: +Usage: test [OPTIONS] -OPTIONS: +Options: -a, --all Also do versioning for private crates (will not be published) --exact Specify inter dependency version numbers @@ -478,10 +478,10 @@ OPTIONS: fn possible_value_wrapped_help() { static WRAPPED_HELP: &str = "test -USAGE: +Usage: test [OPTIONS] -OPTIONS: +Options: --possible-values Possible values: - short_name: @@ -545,13 +545,13 @@ fn complex_subcommand_help_output() { Kevin K. tests subcommands -USAGE: +Usage: clap-test subcmd [OPTIONS] [--] [scpositional] -ARGS: +Arguments: tests positionals -OPTIONS: +Options: -o, --option ... tests options -f, --flag... tests flags -s, --subcmdarg tests other args @@ -567,10 +567,10 @@ OPTIONS: fn issue_626_unicode_cutoff() { static ISSUE_626_CUTOFF: &str = "ctest 0.1 -USAGE: +Usage: ctest [OPTIONS] -OPTIONS: +Options: -c, --cafe A coffeehouse, coffee shop, or café is an establishment which primarily serves hot coffee, related coffee beverages (e.g., café @@ -603,10 +603,10 @@ OPTIONS: static HIDE_POS_VALS: &str = "ctest 0.1 -USAGE: +Usage: ctest [OPTIONS] -OPTIONS: +Options: -p, --pos Some vals [possible values: fast, slow] -c, --cafe A coffeehouse, coffee shop, or café. -h, --help Print help information @@ -671,10 +671,10 @@ fn hide_single_possible_val() { fn possible_vals_with_help() { static POS_VALS_HELP: &str = "ctest 0.1 -USAGE: +Usage: ctest [OPTIONS] -OPTIONS: +Options: -p, --pos Some vals @@ -721,10 +721,10 @@ OPTIONS: fn issue_626_panic() { static ISSUE_626_PANIC: &str = "ctest 0.1 -USAGE: +Usage: ctest [OPTIONS] -OPTIONS: +Options: -c, --cafe La culture du café est très développée dans de nombreux pays à climat chaud @@ -777,10 +777,10 @@ fn issue_626_variable_panic() { fn final_word_wrapping() { static FINAL_WORD_WRAPPING: &str = "ctest 0.1 -USAGE: +Usage: ctest -OPTIONS: +Options: -h, --help Print help information @@ -797,10 +797,10 @@ OPTIONS: static WRAPPING_NEWLINE_CHARS: &str = "ctest 0.1 -USAGE: +Usage: ctest [mode] -ARGS: +Arguments: x, max, maximum 20 characters, contains symbols. l, long Copy-friendly, 14 @@ -808,7 +808,7 @@ ARGS: m, med, medium Copy-friendly, 8 characters, contains symbols. -OPTIONS: +Options: -h, --help Print help information -V, --version Print version information "; @@ -853,10 +853,10 @@ fn dont_wrap_urls() { const EXPECTED: &str = "\ Example-update -USAGE: +Usage: Example update [OPTIONS] -OPTIONS: +Options: --force-non-host Install toolchains that require an @@ -872,10 +872,10 @@ OPTIONS: static OLD_NEWLINE_CHARS: &str = "ctest 0.1 -USAGE: +Usage: ctest [OPTIONS] -OPTIONS: +Options: -m Some help with some wrapping (Defaults to something) -h, --help Print help information @@ -908,10 +908,10 @@ fn old_newline_variables() { fn issue_688_hide_pos_vals() { static ISSUE_688: &str = "ctest 0.1 -USAGE: +Usage: ctest [OPTIONS] -OPTIONS: +Options: --filter Sets the filter, or sampling method, to use for interpolation when resizing the particle images. The default is Linear (Bilinear). [possible values: Nearest, Linear, Cubic, Gaussian, Lanczos3] @@ -961,14 +961,14 @@ fn issue_702_multiple_values() { foo bar -USAGE: +Usage: myapp [OPTIONS] [--] [ARGS] -ARGS: +Arguments: some option ... some option -OPTIONS: +Options: -s, --some some option -o, --other some other option -l, --label