diff --git a/examples/cargo-example-derive.md b/examples/cargo-example-derive.md index b1c20448930..f1737e05869 100644 --- a/examples/cargo-example-derive.md +++ b/examples/cargo-example-derive.md @@ -6,8 +6,7 @@ mimicking cargo's interface. The help looks like: ```console $ cargo-example-derive --help -Usage: - cargo +Usage: cargo Commands: example-derive A simple to use, efficient, and full-featured Command Line Argument Parser @@ -19,8 +18,7 @@ Options: $ cargo-example-derive example-derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - cargo example-derive [OPTIONS] +Usage: cargo example-derive [OPTIONS] Options: --manifest-path diff --git a/examples/cargo-example.md b/examples/cargo-example.md index 9e3a53d381c..ccb33b54f8f 100644 --- a/examples/cargo-example.md +++ b/examples/cargo-example.md @@ -6,8 +6,7 @@ mimicking cargo's interface. The help looks like: ```console $ cargo-example --help -Usage: - cargo +Usage: cargo Commands: example A simple to use, efficient, and full-featured Command Line Argument Parser @@ -19,8 +18,7 @@ Options: $ cargo-example example --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - cargo example [OPTIONS] +Usage: cargo example [OPTIONS] Options: --manifest-path diff --git a/examples/demo.md b/examples/demo.md index 1376e588ed8..98bd4514ce8 100644 --- a/examples/demo.md +++ b/examples/demo.md @@ -2,8 +2,7 @@ $ demo --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - demo[EXE] [OPTIONS] --name +Usage: demo[EXE] [OPTIONS] --name Options: -n, --name Name of the person to greet diff --git a/examples/derive_ref/custom-bool.md b/examples/derive_ref/custom-bool.md index 177864ac99c..bce4bc5cdad 100644 --- a/examples/derive_ref/custom-bool.md +++ b/examples/derive_ref/custom-bool.md @@ -6,8 +6,7 @@ Example of overriding the magic `bool` behavior $ custom-bool --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - custom-bool[EXE] [OPTIONS] --foo +Usage: custom-bool[EXE] [OPTIONS] --foo Arguments: [possible values: true, false] @@ -24,8 +23,7 @@ error: The following required arguments were not provided: --foo -Usage: - custom-bool[EXE] --foo +Usage: custom-bool[EXE] --foo For more information try --help diff --git a/examples/derive_ref/interop_tests.md b/examples/derive_ref/interop_tests.md index b6dc37824d6..d30c857e5c2 100644 --- a/examples/derive_ref/interop_tests.md +++ b/examples/derive_ref/interop_tests.md @@ -39,8 +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: - interop_augment_args[EXE] [OPTIONS] +Usage: interop_augment_args[EXE] [OPTIONS] For more information try --help @@ -77,8 +76,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: - interop_augment_subcommands[EXE] derived [OPTIONS] +Usage: interop_augment_subcommands[EXE] derived [OPTIONS] For more information try --help @@ -89,8 +87,7 @@ $ interop_augment_subcommands unknown ? failed error: Found argument 'unknown' which wasn't expected, or isn't valid in this context -Usage: - interop_augment_subcommands[EXE] [COMMAND] +Usage: interop_augment_subcommands[EXE] [COMMAND] For more information try --help @@ -101,8 +98,7 @@ For more information try --help ```console $ interop_hand_subcommand ? failed -Usage: - interop_hand_subcommand[EXE] [OPTIONS] +Usage: interop_hand_subcommand[EXE] [OPTIONS] Commands: add @@ -152,8 +148,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: - interop_hand_subcommand[EXE] add [NAME]... +Usage: interop_hand_subcommand[EXE] add [NAME]... For more information try --help @@ -196,8 +191,7 @@ $ interop_hand_subcommand unknown ? failed error: Found argument 'unknown' which wasn't expected, or isn't valid in this context -Usage: - interop_hand_subcommand[EXE] [OPTIONS] +Usage: interop_hand_subcommand[EXE] [OPTIONS] For more information try --help @@ -253,8 +247,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: - interop_flatten_hand_args[EXE] [OPTIONS] +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 01c34e9354c..b82bddfcd97 100644 --- a/examples/escaped-positional-derive.md +++ b/examples/escaped-positional-derive.md @@ -7,8 +7,7 @@ Let's see what this looks like in the help: $ escaped-positional-derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - escaped-positional-derive[EXE] [OPTIONS] [-- ...] +Usage: escaped-positional-derive[EXE] [OPTIONS] [-- ...] Arguments: [SLOP]... @@ -36,8 +35,7 @@ $ escaped-positional-derive foo bar ? failed error: Found argument 'foo' which wasn't expected, or isn't valid in this context -Usage: - escaped-positional-derive[EXE] [OPTIONS] [-- ...] +Usage: escaped-positional-derive[EXE] [OPTIONS] [-- ...] For more information try --help diff --git a/examples/escaped-positional.md b/examples/escaped-positional.md index 5b7203308c7..f0195091fbe 100644 --- a/examples/escaped-positional.md +++ b/examples/escaped-positional.md @@ -7,8 +7,7 @@ Let's see what this looks like in the help: $ escaped-positional --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - escaped-positional[EXE] [OPTIONS] [-- ...] +Usage: escaped-positional[EXE] [OPTIONS] [-- ...] Arguments: [SLOP]... @@ -36,8 +35,7 @@ $ escaped-positional foo bar ? failed error: Found argument 'foo' which wasn't expected, or isn't valid in this context -Usage: - escaped-positional[EXE] [OPTIONS] [-- ...] +Usage: escaped-positional[EXE] [OPTIONS] [-- ...] For more information try --help diff --git a/examples/find.md b/examples/find.md index 61503699ae7..4a18e4456cf 100644 --- a/examples/find.md +++ b/examples/find.md @@ -4,8 +4,7 @@ $ find --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - find[EXE] [OPTIONS] --name +Usage: find[EXE] [OPTIONS] --name Options: -h, --help Print help information diff --git a/examples/git-derive.md b/examples/git-derive.md index 2f6af8e8e4e..b52d492c751 100644 --- a/examples/git-derive.md +++ b/examples/git-derive.md @@ -8,8 +8,7 @@ $ git-derive ? failed A fictional versioning CLI -Usage: - git-derive[EXE] +Usage: git-derive[EXE] Commands: clone Clones repos @@ -24,8 +23,7 @@ Options: $ git-derive help A fictional versioning CLI -Usage: - git-derive[EXE] +Usage: git-derive[EXE] Commands: clone Clones repos @@ -40,8 +38,7 @@ Options: $ git-derive help add adds things -Usage: - git-derive[EXE] add ... +Usage: git-derive[EXE] add ... Arguments: ... Stuff to add @@ -57,8 +54,7 @@ $ git-derive add ? failed adds things -Usage: - git-derive[EXE] add ... +Usage: git-derive[EXE] add ... Arguments: ... Stuff to add @@ -74,9 +70,8 @@ Adding ["Cargo.toml", "Cargo.lock"] Default subcommand: ```console $ git-derive stash -h -Usage: - git-derive[EXE] stash [OPTIONS] - git-derive[EXE] stash +Usage: git-derive[EXE] stash [OPTIONS] + git-derive[EXE] stash Commands: push @@ -89,16 +84,14 @@ Options: -h, --help Print help information $ git-derive stash push -h -Usage: - git-derive[EXE] stash push [OPTIONS] +Usage: git-derive[EXE] stash push [OPTIONS] Options: -m, --message -h, --help Print help information $ git-derive stash pop -h -Usage: - git-derive[EXE] stash pop [STASH] +Usage: git-derive[EXE] stash pop [STASH] Arguments: [STASH] diff --git a/examples/git.md b/examples/git.md index 4e4e4f59702..89d0d789133 100644 --- a/examples/git.md +++ b/examples/git.md @@ -6,8 +6,7 @@ $ git ? failed A fictional versioning CLI -Usage: - git[EXE] +Usage: git[EXE] Commands: clone Clones repos @@ -22,8 +21,7 @@ Options: $ git help A fictional versioning CLI -Usage: - git[EXE] +Usage: git[EXE] Commands: clone Clones repos @@ -38,8 +36,7 @@ Options: $ git help add adds things -Usage: - git[EXE] add ... +Usage: git[EXE] add ... Arguments: ... Stuff to add @@ -55,8 +52,7 @@ $ git add ? failed adds things -Usage: - git[EXE] add ... +Usage: git[EXE] add ... Arguments: ... Stuff to add @@ -72,9 +68,8 @@ Adding ["Cargo.toml", "Cargo.lock"] Default subcommand: ```console $ git stash -h -Usage: - git[EXE] stash [OPTIONS] - git[EXE] stash +Usage: git[EXE] stash [OPTIONS] + git[EXE] stash Commands: push @@ -87,16 +82,14 @@ Options: -h, --help Print help information $ git stash push -h -Usage: - git[EXE] stash push [OPTIONS] +Usage: git[EXE] stash push [OPTIONS] Options: -m, --message -h, --help Print help information $ git stash pop -h -Usage: - git[EXE] stash pop [STASH] +Usage: git[EXE] stash pop [STASH] Arguments: [STASH] diff --git a/examples/multicall-busybox.md b/examples/multicall-busybox.md index a824b7f4d2f..32efe027c98 100644 --- a/examples/multicall-busybox.md +++ b/examples/multicall-busybox.md @@ -25,8 +25,7 @@ Though users must pass something: ```console $ busybox ? failed -Usage: - busybox [OPTIONS] [APPLET] +Usage: busybox [OPTIONS] [APPLET] APPLETS: true does nothing successfully diff --git a/examples/pacman.md b/examples/pacman.md index 2788e9cb6db..a691c5ae5f9 100644 --- a/examples/pacman.md +++ b/examples/pacman.md @@ -37,8 +37,7 @@ In the help, this looks like: $ pacman -h package manager utility -Usage: - pacman[EXE] +Usage: pacman[EXE] Commands: query -Q --query Query the package database. @@ -52,8 +51,7 @@ Options: $ pacman -S -h Synchronize packages. -Usage: - pacman[EXE] {sync|--sync|-S} [OPTIONS] [package]... +Usage: pacman[EXE] {sync|--sync|-S} [OPTIONS] [package]... Arguments: [package]... packages @@ -71,8 +69,7 @@ $ pacman -S -s foo -i bar ? failed error: The argument '--search ...' cannot be used with '--info' -Usage: - pacman[EXE] {sync|--sync|-S} --search ... ... +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 5850ff6601e..8675fb4c645 100644 --- a/examples/tutorial_builder/01_quick.md +++ b/examples/tutorial_builder/01_quick.md @@ -2,8 +2,7 @@ $ 01_quick --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 01_quick[EXE] [OPTIONS] [name] [COMMAND] +Usage: 01_quick[EXE] [OPTIONS] [name] [COMMAND] Commands: test does testing things diff --git a/examples/tutorial_builder/02_app_settings.md b/examples/tutorial_builder/02_app_settings.md index d3989830cb2..4e70f645703 100644 --- a/examples/tutorial_builder/02_app_settings.md +++ b/examples/tutorial_builder/02_app_settings.md @@ -2,8 +2,7 @@ $ 02_app_settings --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 02_app_settings[EXE] --two --one +Usage: 02_app_settings[EXE] --two --one Options: --two diff --git a/examples/tutorial_builder/02_apps.md b/examples/tutorial_builder/02_apps.md index 0eba26bd64d..2f3deac0076 100644 --- a/examples/tutorial_builder/02_apps.md +++ b/examples/tutorial_builder/02_apps.md @@ -2,8 +2,7 @@ $ 02_apps --help Does awesome things -Usage: - 02_apps[EXE] --two --one +Usage: 02_apps[EXE] --two --one Options: --two diff --git a/examples/tutorial_builder/02_crate.md b/examples/tutorial_builder/02_crate.md index b684bcb087c..a3417d30aa4 100644 --- a/examples/tutorial_builder/02_crate.md +++ b/examples/tutorial_builder/02_crate.md @@ -2,8 +2,7 @@ $ 02_crate --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 02_crate[EXE] --two --one +Usage: 02_crate[EXE] --two --one Options: --two diff --git a/examples/tutorial_builder/03_01_flag_bool.md b/examples/tutorial_builder/03_01_flag_bool.md index 71f8e78f8ba..d4ae7040fde 100644 --- a/examples/tutorial_builder/03_01_flag_bool.md +++ b/examples/tutorial_builder/03_01_flag_bool.md @@ -2,8 +2,7 @@ $ 03_01_flag_bool --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_01_flag_bool[EXE] [OPTIONS] +Usage: 03_01_flag_bool[EXE] [OPTIONS] Options: -v, --verbose diff --git a/examples/tutorial_builder/03_01_flag_count.md b/examples/tutorial_builder/03_01_flag_count.md index fc9e07224dd..ee9f94404b5 100644 --- a/examples/tutorial_builder/03_01_flag_count.md +++ b/examples/tutorial_builder/03_01_flag_count.md @@ -2,8 +2,7 @@ $ 03_01_flag_count --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_01_flag_count[EXE] [OPTIONS] +Usage: 03_01_flag_count[EXE] [OPTIONS] Options: -v, --verbose... diff --git a/examples/tutorial_builder/03_02_option.md b/examples/tutorial_builder/03_02_option.md index b2bbdc11aa1..0457ac4edd7 100644 --- a/examples/tutorial_builder/03_02_option.md +++ b/examples/tutorial_builder/03_02_option.md @@ -2,8 +2,7 @@ $ 03_02_option --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_02_option[EXE] [OPTIONS] +Usage: 03_02_option[EXE] [OPTIONS] Options: -n, --name diff --git a/examples/tutorial_builder/03_02_option_mult.md b/examples/tutorial_builder/03_02_option_mult.md index be913e8869e..a2161436a8f 100644 --- a/examples/tutorial_builder/03_02_option_mult.md +++ b/examples/tutorial_builder/03_02_option_mult.md @@ -2,8 +2,7 @@ $ 03_02_option_mult --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_02_option_mult[EXE] [OPTIONS] +Usage: 03_02_option_mult[EXE] [OPTIONS] Options: -n, --name diff --git a/examples/tutorial_builder/03_03_positional.md b/examples/tutorial_builder/03_03_positional.md index 25f137b1385..7918284761d 100644 --- a/examples/tutorial_builder/03_03_positional.md +++ b/examples/tutorial_builder/03_03_positional.md @@ -2,8 +2,7 @@ $ 03_03_positional --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_03_positional[EXE] [name] +Usage: 03_03_positional[EXE] [name] Arguments: [name] diff --git a/examples/tutorial_builder/03_03_positional_mult.md b/examples/tutorial_builder/03_03_positional_mult.md index 7bf1c55c6ea..2f9ff419729 100644 --- a/examples/tutorial_builder/03_03_positional_mult.md +++ b/examples/tutorial_builder/03_03_positional_mult.md @@ -2,8 +2,7 @@ $ 03_03_positional_mult --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_03_positional_mult[EXE] [name]... +Usage: 03_03_positional_mult[EXE] [name]... Arguments: [name]... diff --git a/examples/tutorial_builder/03_04_subcommands.md b/examples/tutorial_builder/03_04_subcommands.md index 0c41a773a2d..a2636dd7798 100644 --- a/examples/tutorial_builder/03_04_subcommands.md +++ b/examples/tutorial_builder/03_04_subcommands.md @@ -2,8 +2,7 @@ $ 03_04_subcommands help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_04_subcommands[EXE] +Usage: 03_04_subcommands[EXE] Commands: add Adds files to myapp @@ -16,8 +15,7 @@ Options: $ 03_04_subcommands help add Adds files to myapp -Usage: - 03_04_subcommands[EXE] add [NAME] +Usage: 03_04_subcommands[EXE] add [NAME] Arguments: [NAME] @@ -37,8 +35,7 @@ $ 03_04_subcommands ? failed A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_04_subcommands[EXE] +Usage: 03_04_subcommands[EXE] Commands: add Adds files to myapp diff --git a/examples/tutorial_builder/03_05_default_values.md b/examples/tutorial_builder/03_05_default_values.md index 65e54773ce0..283c4ba2dc0 100644 --- a/examples/tutorial_builder/03_05_default_values.md +++ b/examples/tutorial_builder/03_05_default_values.md @@ -2,8 +2,7 @@ $ 03_05_default_values --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_05_default_values[EXE] [NAME] +Usage: 03_05_default_values[EXE] [NAME] Arguments: [NAME] [default: alice] diff --git a/examples/tutorial_builder/04_01_enum.md b/examples/tutorial_builder/04_01_enum.md index cea785a7430..a9baa540659 100644 --- a/examples/tutorial_builder/04_01_enum.md +++ b/examples/tutorial_builder/04_01_enum.md @@ -2,8 +2,7 @@ $ 04_01_enum --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_01_enum[EXE] +Usage: 04_01_enum[EXE] Arguments: What mode to run the program in [possible values: fast, slow] diff --git a/examples/tutorial_builder/04_01_possible.md b/examples/tutorial_builder/04_01_possible.md index 5058ae53cda..a52b1245cb7 100644 --- a/examples/tutorial_builder/04_01_possible.md +++ b/examples/tutorial_builder/04_01_possible.md @@ -2,8 +2,7 @@ $ 04_01_possible --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_01_possible[EXE] +Usage: 04_01_possible[EXE] Arguments: What mode to run the program in [possible values: fast, slow] diff --git a/examples/tutorial_builder/04_02_parse.md b/examples/tutorial_builder/04_02_parse.md index bad91021ba8..da6e81ad6d4 100644 --- a/examples/tutorial_builder/04_02_parse.md +++ b/examples/tutorial_builder/04_02_parse.md @@ -2,8 +2,7 @@ $ 04_02_parse --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_02_parse[EXE] +Usage: 04_02_parse[EXE] Arguments: Network port to use diff --git a/examples/tutorial_builder/04_02_validate.md b/examples/tutorial_builder/04_02_validate.md index 61abe5d33fe..1e048d2a29e 100644 --- a/examples/tutorial_builder/04_02_validate.md +++ b/examples/tutorial_builder/04_02_validate.md @@ -2,8 +2,7 @@ $ 04_02_validate --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_02_validate[EXE] +Usage: 04_02_validate[EXE] Arguments: Network port to use diff --git a/examples/tutorial_builder/04_03_relations.md b/examples/tutorial_builder/04_03_relations.md index 4e66b8cc135..d58521291a6 100644 --- a/examples/tutorial_builder/04_03_relations.md +++ b/examples/tutorial_builder/04_03_relations.md @@ -2,8 +2,7 @@ $ 04_03_relations --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_03_relations[EXE] [OPTIONS] <--set-ver |--major|--minor|--patch> [INPUT_FILE] +Usage: 04_03_relations[EXE] [OPTIONS] <--set-ver |--major|--minor|--patch> [INPUT_FILE] Arguments: [INPUT_FILE] some regular input @@ -23,8 +22,7 @@ $ 04_03_relations error: The following required arguments were not provided: <--set-ver |--major|--minor|--patch> -Usage: - 04_03_relations[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] +Usage: 04_03_relations[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] For more information try --help @@ -35,8 +33,7 @@ $ 04_03_relations --major --minor ? failed error: The argument '--major' cannot be used with '--minor' -Usage: - 04_03_relations[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] +Usage: 04_03_relations[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] For more information try --help @@ -45,8 +42,7 @@ $ 04_03_relations --major -c config.toml error: The following required arguments were not provided: > -Usage: - 04_03_relations[EXE] -c <--set-ver |--major|--minor|--patch> > +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 9422f8a518b..49f705fe36c 100644 --- a/examples/tutorial_builder/04_04_custom.md +++ b/examples/tutorial_builder/04_04_custom.md @@ -2,8 +2,7 @@ $ 04_04_custom --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] +Usage: 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] Arguments: [INPUT_FILE] some regular input @@ -22,8 +21,7 @@ $ 04_04_custom ? failed error: Can only modify one version field -Usage: - 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] +Usage: 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] For more information try --help @@ -34,8 +32,7 @@ $ 04_04_custom --major --minor ? failed error: Can only modify one version field -Usage: - 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] +Usage: 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] For more information try --help @@ -44,8 +41,7 @@ $ 04_04_custom --major -c config.toml Version: 2.2.3 error: INPUT_FILE or --spec-in is required when using --config -Usage: - 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] +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 e361ccbff6d..7781ad3118d 100644 --- a/examples/tutorial_derive/01_quick.md +++ b/examples/tutorial_derive/01_quick.md @@ -2,8 +2,7 @@ $ 01_quick_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 01_quick_derive[EXE] [OPTIONS] [NAME] [COMMAND] +Usage: 01_quick_derive[EXE] [OPTIONS] [NAME] [COMMAND] Commands: test does testing things diff --git a/examples/tutorial_derive/02_app_settings.md b/examples/tutorial_derive/02_app_settings.md index 4efd7fd0369..ee507a61c02 100644 --- a/examples/tutorial_derive/02_app_settings.md +++ b/examples/tutorial_derive/02_app_settings.md @@ -2,8 +2,7 @@ $ 02_app_settings_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 02_app_settings_derive[EXE] --two --one +Usage: 02_app_settings_derive[EXE] --two --one Options: --two diff --git a/examples/tutorial_derive/02_apps.md b/examples/tutorial_derive/02_apps.md index 860fee05075..52c7cc78fb8 100644 --- a/examples/tutorial_derive/02_apps.md +++ b/examples/tutorial_derive/02_apps.md @@ -2,8 +2,7 @@ $ 02_apps_derive --help Does awesome things -Usage: - 02_apps_derive[EXE] --two --one +Usage: 02_apps_derive[EXE] --two --one Options: --two diff --git a/examples/tutorial_derive/02_crate.md b/examples/tutorial_derive/02_crate.md index a87c3e3c140..83848f5e11f 100644 --- a/examples/tutorial_derive/02_crate.md +++ b/examples/tutorial_derive/02_crate.md @@ -2,8 +2,7 @@ $ 02_crate_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 02_crate_derive[EXE] --two --one +Usage: 02_crate_derive[EXE] --two --one Options: --two diff --git a/examples/tutorial_derive/03_01_flag_bool.md b/examples/tutorial_derive/03_01_flag_bool.md index a42daab8b3c..a712a0f5b34 100644 --- a/examples/tutorial_derive/03_01_flag_bool.md +++ b/examples/tutorial_derive/03_01_flag_bool.md @@ -2,8 +2,7 @@ $ 03_01_flag_bool_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_01_flag_bool_derive[EXE] [OPTIONS] +Usage: 03_01_flag_bool_derive[EXE] [OPTIONS] Options: -v, --verbose diff --git a/examples/tutorial_derive/03_01_flag_count.md b/examples/tutorial_derive/03_01_flag_count.md index 85ea7fd2830..f16ec3328bb 100644 --- a/examples/tutorial_derive/03_01_flag_count.md +++ b/examples/tutorial_derive/03_01_flag_count.md @@ -2,8 +2,7 @@ $ 03_01_flag_count_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_01_flag_count_derive[EXE] [OPTIONS] +Usage: 03_01_flag_count_derive[EXE] [OPTIONS] Options: -v, --verbose... diff --git a/examples/tutorial_derive/03_02_option.md b/examples/tutorial_derive/03_02_option.md index db935201106..ca692cd6a81 100644 --- a/examples/tutorial_derive/03_02_option.md +++ b/examples/tutorial_derive/03_02_option.md @@ -2,8 +2,7 @@ $ 03_02_option_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_02_option_derive[EXE] [OPTIONS] +Usage: 03_02_option_derive[EXE] [OPTIONS] Options: -n, --name diff --git a/examples/tutorial_derive/03_02_option_mult.md b/examples/tutorial_derive/03_02_option_mult.md index 308c8e3944d..54a851a8935 100644 --- a/examples/tutorial_derive/03_02_option_mult.md +++ b/examples/tutorial_derive/03_02_option_mult.md @@ -2,8 +2,7 @@ $ 03_02_option_mult_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_02_option_mult_derive[EXE] [OPTIONS] +Usage: 03_02_option_mult_derive[EXE] [OPTIONS] Options: -n, --name diff --git a/examples/tutorial_derive/03_03_positional.md b/examples/tutorial_derive/03_03_positional.md index 4280c8ecbed..40c290499cc 100644 --- a/examples/tutorial_derive/03_03_positional.md +++ b/examples/tutorial_derive/03_03_positional.md @@ -2,8 +2,7 @@ $ 03_03_positional_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_03_positional_derive[EXE] [NAME] +Usage: 03_03_positional_derive[EXE] [NAME] Arguments: [NAME] diff --git a/examples/tutorial_derive/03_03_positional_mult.md b/examples/tutorial_derive/03_03_positional_mult.md index 3c003f24ee3..389eeb0f2bd 100644 --- a/examples/tutorial_derive/03_03_positional_mult.md +++ b/examples/tutorial_derive/03_03_positional_mult.md @@ -2,8 +2,7 @@ $ 03_03_positional_mult_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_03_positional_mult_derive[EXE] [NAME]... +Usage: 03_03_positional_mult_derive[EXE] [NAME]... Arguments: [NAME]... diff --git a/examples/tutorial_derive/03_04_subcommands.md b/examples/tutorial_derive/03_04_subcommands.md index 480789abfe9..ca937c9fc2b 100644 --- a/examples/tutorial_derive/03_04_subcommands.md +++ b/examples/tutorial_derive/03_04_subcommands.md @@ -2,8 +2,7 @@ $ 03_04_subcommands_derive help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_04_subcommands_derive[EXE] +Usage: 03_04_subcommands_derive[EXE] Commands: add Adds files to myapp @@ -16,8 +15,7 @@ Options: $ 03_04_subcommands_derive help add Adds files to myapp -Usage: - 03_04_subcommands_derive[EXE] add [NAME] +Usage: 03_04_subcommands_derive[EXE] add [NAME] Arguments: [NAME] @@ -37,8 +35,7 @@ $ 03_04_subcommands_derive ? failed A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_04_subcommands_derive[EXE] +Usage: 03_04_subcommands_derive[EXE] Commands: add Adds files to myapp diff --git a/examples/tutorial_derive/03_05_default_values.md b/examples/tutorial_derive/03_05_default_values.md index 5ee06acfd80..1f8de815bc0 100644 --- a/examples/tutorial_derive/03_05_default_values.md +++ b/examples/tutorial_derive/03_05_default_values.md @@ -2,8 +2,7 @@ $ 03_05_default_values_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 03_05_default_values_derive[EXE] [NAME] +Usage: 03_05_default_values_derive[EXE] [NAME] Arguments: [NAME] [default: alice] diff --git a/examples/tutorial_derive/04_01_enum.md b/examples/tutorial_derive/04_01_enum.md index 5d16ff45ad6..6b334efea2e 100644 --- a/examples/tutorial_derive/04_01_enum.md +++ b/examples/tutorial_derive/04_01_enum.md @@ -2,8 +2,7 @@ $ 04_01_enum_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_01_enum_derive[EXE] +Usage: 04_01_enum_derive[EXE] Arguments: What mode to run the program in [possible values: fast, slow] diff --git a/examples/tutorial_derive/04_02_parse.md b/examples/tutorial_derive/04_02_parse.md index ba0a036d358..bb659d82033 100644 --- a/examples/tutorial_derive/04_02_parse.md +++ b/examples/tutorial_derive/04_02_parse.md @@ -2,8 +2,7 @@ $ 04_02_parse_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_02_parse_derive[EXE] +Usage: 04_02_parse_derive[EXE] Arguments: Network port to use diff --git a/examples/tutorial_derive/04_02_validate.md b/examples/tutorial_derive/04_02_validate.md index b58b871d213..92f5fd1a0bb 100644 --- a/examples/tutorial_derive/04_02_validate.md +++ b/examples/tutorial_derive/04_02_validate.md @@ -2,8 +2,7 @@ $ 04_02_validate_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_02_validate_derive[EXE] +Usage: 04_02_validate_derive[EXE] Arguments: Network port to use diff --git a/examples/tutorial_derive/04_03_relations.md b/examples/tutorial_derive/04_03_relations.md index 16ec9ade43e..7ce0a5ce460 100644 --- a/examples/tutorial_derive/04_03_relations.md +++ b/examples/tutorial_derive/04_03_relations.md @@ -2,8 +2,7 @@ $ 04_03_relations_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_03_relations_derive[EXE] [OPTIONS] <--set-ver |--major|--minor|--patch> [INPUT_FILE] +Usage: 04_03_relations_derive[EXE] [OPTIONS] <--set-ver |--major|--minor|--patch> [INPUT_FILE] Arguments: [INPUT_FILE] some regular input @@ -23,8 +22,7 @@ $ 04_03_relations_derive error: The following required arguments were not provided: <--set-ver |--major|--minor|--patch> -Usage: - 04_03_relations_derive[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] +Usage: 04_03_relations_derive[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] For more information try --help @@ -35,8 +33,7 @@ $ 04_03_relations_derive --major --minor ? failed error: The argument '--major' cannot be used with '--minor' -Usage: - 04_03_relations_derive[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] +Usage: 04_03_relations_derive[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] For more information try --help @@ -45,8 +42,7 @@ $ 04_03_relations_derive --major -c config.toml error: The following required arguments were not provided: > -Usage: - 04_03_relations_derive[EXE] -c <--set-ver |--major|--minor|--patch> > +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 d81d0c9bf91..e6f7fc28eed 100644 --- a/examples/tutorial_derive/04_04_custom.md +++ b/examples/tutorial_derive/04_04_custom.md @@ -2,8 +2,7 @@ $ 04_04_custom_derive --help A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - 04_04_custom_derive[EXE] [OPTIONS] [INPUT_FILE] +Usage: 04_04_custom_derive[EXE] [OPTIONS] [INPUT_FILE] Arguments: [INPUT_FILE] some regular input @@ -22,8 +21,7 @@ $ 04_04_custom_derive ? failed error: Can only modify one version field -Usage: - clap [OPTIONS] [INPUT_FILE] +Usage: clap [OPTIONS] [INPUT_FILE] For more information try --help @@ -34,8 +32,7 @@ $ 04_04_custom_derive --major --minor ? failed error: Can only modify one version field -Usage: - clap [OPTIONS] [INPUT_FILE] +Usage: clap [OPTIONS] [INPUT_FILE] For more information try --help @@ -44,8 +41,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: - clap [OPTIONS] [INPUT_FILE] +Usage: clap [OPTIONS] [INPUT_FILE] For more information try --help diff --git a/examples/typed-derive.md b/examples/typed-derive.md index 674a8cc42ec..32429feb4ff 100644 --- a/examples/typed-derive.md +++ b/examples/typed-derive.md @@ -3,8 +3,7 @@ Help: ```console $ typed-derive --help -Usage: - typed-derive[EXE] [OPTIONS] +Usage: typed-derive[EXE] [OPTIONS] Options: -O Implicitly using `std::str::FromStr` diff --git a/src/builder/arg.rs b/src/builder/arg.rs index 3a881fbc8a2..136f2f21f1a 100644 --- a/src/builder/arg.rs +++ b/src/builder/arg.rs @@ -1103,8 +1103,7 @@ impl Arg { /// ```text /// valnames /// - /// Usage: - /// valnames [OPTIONS] + /// Usage: valnames [OPTIONS] /// /// Options: /// --config Some help text @@ -1160,8 +1159,7 @@ impl Arg { /// ```text /// valnames /// - /// Usage: - /// valnames [OPTIONS] + /// Usage: valnames [OPTIONS] /// /// Options: /// -h, --help Print help information @@ -1971,8 +1969,7 @@ impl Arg { /// ```notrust /// helptest /// - /// Usage: - /// helptest [OPTIONS] + /// Usage: helptest [OPTIONS] /// /// Options: /// --config Some help text describing the --config arg @@ -2025,8 +2022,7 @@ impl Arg { /// ```text /// prog /// - /// Usage: - /// prog [OPTIONS] + /// Usage: prog [OPTIONS] /// /// Options: /// --config @@ -2091,8 +2087,7 @@ impl Arg { /// ```text /// cust-ord /// - /// Usage: - /// cust-ord [OPTIONS] + /// Usage: cust-ord [OPTIONS] /// /// Options: /// -h, --help Print help information @@ -2151,8 +2146,7 @@ impl Arg { /// ```text /// nlh /// - /// Usage: - /// nlh [OPTIONS] + /// Usage: nlh [OPTIONS] /// /// Options: /// -h, --help Print help information @@ -2197,8 +2191,7 @@ impl Arg { /// ```text /// helptest /// - /// Usage: - /// helptest [OPTIONS] + /// Usage: helptest [OPTIONS] /// /// Options: /// -h, --help Print help information @@ -2371,8 +2364,7 @@ impl Arg { /// ```text /// helptest /// - /// Usage: - /// helptest [OPTIONS] + /// Usage: helptest [OPTIONS] /// /// Options: /// -h, --help Print help information @@ -2398,8 +2390,7 @@ impl Arg { /// ```text /// helptest /// - /// Usage: - /// helptest [OPTIONS] + /// Usage: helptest [OPTIONS] /// /// Options: /// --config Some help text describing the --config arg @@ -2444,8 +2435,7 @@ impl Arg { /// ```text /// helptest /// - /// Usage: - /// helptest [OPTIONS] + /// Usage: helptest [OPTIONS] /// /// Options: /// -h, --help Print help information @@ -2471,8 +2461,7 @@ impl Arg { /// ```text /// helptest /// - /// Usage: - /// helptest [OPTIONS] + /// Usage: helptest [OPTIONS] /// /// OPTIONS: /// --config Some help text describing the --config arg diff --git a/src/builder/command.rs b/src/builder/command.rs index a9e2b430f13..564354715ee 100644 --- a/src/builder/command.rs +++ b/src/builder/command.rs @@ -2536,8 +2536,7 @@ impl Command { /// ```text /// cust-ord /// - /// Usage: - /// cust-ord [OPTIONS] + /// Usage: cust-ord [OPTIONS] /// /// Commands: /// beta I should be first! @@ -3004,8 +3003,7 @@ impl Command { /// ```text /// myprog /// - /// Usage: - /// myprog [COMMAND] + /// Usage: myprog [COMMAND] /// /// Commands: /// help Print this message or the help of the given subcommand(s) @@ -3032,16 +3030,15 @@ impl Command { /// ```text /// myprog /// - /// Usage: - /// myprog [THING] - /// - /// Options: - /// -h, --help Print help information - /// -V, --version Print version information + /// Usage: myprog [THING] /// /// Commands: /// help Print this message or the help of the given subcommand(s) /// sub1 + /// + /// Options: + /// -h, --help Print help information + /// -V, --version Print version information /// ``` #[must_use] pub fn subcommand_value_name(mut self, value_name: impl Into) -> Self { @@ -3070,16 +3067,15 @@ impl Command { /// ```text /// myprog /// - /// Usage: - /// myprog [COMMAND] - /// - /// Options: - /// -h, --help Print help information - /// -V, --version Print version information + /// Usage: myprog [COMMAND] /// /// Commands: /// help Print this message or the help of the given subcommand(s) /// sub1 + /// + /// Options: + /// -h, --help Print help information + /// -V, --version Print version information /// ``` /// /// but usage of `subcommand_help_heading` @@ -3098,16 +3094,15 @@ impl Command { /// ```text /// myprog /// - /// Usage: - /// myprog [COMMAND] - /// - /// Options: - /// -h, --help Print help information - /// -V, --version Print version information + /// Usage: myprog [COMMAND] /// /// Things: /// help Print this message or the help of the given subcommand(s) /// sub1 + /// + /// Options: + /// -h, --help Print help information + /// -V, --version Print version information /// ``` #[must_use] pub fn subcommand_help_heading(mut self, heading: impl Into) -> Self { diff --git a/src/output/help.rs b/src/output/help.rs index b1be589c7ac..edc09cf8f18 100644 --- a/src/output/help.rs +++ b/src/output/help.rs @@ -32,16 +32,14 @@ pub(crate) struct Help<'cmd, 'writer> { impl<'cmd, 'writer> Help<'cmd, 'writer> { const DEFAULT_TEMPLATE: &'static str = "\ {before-help}{about-with-newline} -{usage-heading} -{tab}{usage} +{usage-heading} {usage} {all-args}{after-help}\ "; const DEFAULT_NO_ARGS_TEMPLATE: &'static str = "\ {before-help}{about-with-newline} -{usage-heading} -{tab}{usage}{after-help}\ +{usage-heading} {usage}{after-help}\ "; /// Create a new `Help` instance. diff --git a/src/output/usage.rs b/src/output/usage.rs index 3ba8b60c0e0..694a306ee2b 100644 --- a/src/output/usage.rs +++ b/src/output/usage.rs @@ -1,7 +1,6 @@ // Internal use crate::builder::StyledStr; use crate::builder::{ArgPredicate, Command}; -use crate::output::TAB; use crate::parser::ArgMatcher; use crate::util::ChildGraph; use crate::util::FlatSet; @@ -33,8 +32,7 @@ impl<'cmd> Usage<'cmd> { debug!("Usage::create_usage_with_title"); let mut styled = StyledStr::new(); styled.header("Usage:"); - styled.none("\n"); - styled.none(TAB); + styled.none(" "); styled.extend(self.create_usage_no_title(used).into_iter()); styled } @@ -80,7 +78,7 @@ impl<'cmd> Usage<'cmd> { || self.cmd.is_args_conflicts_with_subcommands_set() { styled.none("\n"); - styled.none(TAB); + styled.none(" "); if self.cmd.is_args_conflicts_with_subcommands_set() { // Short-circuit full usage creation since no args will be relevant styled.literal(name); diff --git a/tests/builder/app_settings.rs b/tests/builder/app_settings.rs index edef5581d9a..845eab2f736 100644 --- a/tests/builder/app_settings.rs +++ b/tests/builder/app_settings.rs @@ -5,8 +5,7 @@ use super::utils; use clap::{arg, error::ErrorKind, Arg, ArgAction, Command}; static ALLOW_EXT_SC: &str = "\ -Usage: - clap-test [COMMAND] +Usage: clap-test [COMMAND] Options: -h, --help Print help information @@ -14,8 +13,7 @@ Options: "; static DONT_COLLAPSE_ARGS: &str = "\ -Usage: - clap-test [arg1] [arg2] [arg3] +Usage: clap-test [arg1] [arg2] [arg3] Arguments: [arg1] some @@ -124,8 +122,7 @@ fn arg_required_else_help_with_default() { #[test] fn arg_required_else_help_error_message() { static ARG_REQUIRED_ELSE_HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -i, --info Provides more info @@ -284,8 +281,7 @@ fn skip_possible_values() { static SKIP_POS_VALS: &str = "\ tests stuff -Usage: - test [OPTIONS] [arg1] +Usage: test [OPTIONS] [arg1] Arguments: [arg1] some pos arg @@ -625,8 +621,7 @@ fn dont_collapse_args() { #[test] fn require_eq() { static REQUIRE_EQUALS: &str = "\ -Usage: - clap-test --opt= +Usage: clap-test --opt= Options: -o, --opt= some diff --git a/tests/builder/arg_aliases.rs b/tests/builder/arg_aliases.rs index 21c3df653cd..2e8ac655035 100644 --- a/tests/builder/arg_aliases.rs +++ b/tests/builder/arg_aliases.rs @@ -193,8 +193,7 @@ fn invisible_arg_aliases_help_output() { static SC_INVISIBLE_ALIAS_HELP: &str = "\ Some help -Usage: - ct test [OPTIONS] +Usage: ct test [OPTIONS] Options: -o, --opt @@ -224,8 +223,7 @@ fn visible_arg_aliases_help_output() { static SC_VISIBLE_ALIAS_HELP: &str = "\ Some help -Usage: - ct test [OPTIONS] +Usage: ct test [OPTIONS] Options: -o, --opt [aliases: visible] diff --git a/tests/builder/arg_aliases_short.rs b/tests/builder/arg_aliases_short.rs index 74252fea2e4..c353e3152cb 100644 --- a/tests/builder/arg_aliases_short.rs +++ b/tests/builder/arg_aliases_short.rs @@ -160,8 +160,7 @@ fn invisible_short_arg_aliases_help_output() { static SC_INVISIBLE_ALIAS_HELP: &str = "\ Some help -Usage: - ct test [OPTIONS] +Usage: ct test [OPTIONS] Options: -o, --opt @@ -191,8 +190,7 @@ fn visible_short_arg_aliases_help_output() { static SC_VISIBLE_ALIAS_HELP: &str = "\ Some help -Usage: - ct test [OPTIONS] +Usage: ct test [OPTIONS] Options: -o, --opt [short aliases: v] diff --git a/tests/builder/cargo.rs b/tests/builder/cargo.rs index c4740be1e43..ead49f6de56 100644 --- a/tests/builder/cargo.rs +++ b/tests/builder/cargo.rs @@ -9,8 +9,7 @@ use crate::utils; static DESCRIPTION_ONLY: &str = "prog 1 A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - prog +Usage: prog Options: -h, --help Print help information @@ -20,8 +19,7 @@ Options: static AUTHORS_ONLY: &str = "prog 1 -Usage: - prog +Usage: prog Options: -h, --help Print help information diff --git a/tests/builder/command.rs b/tests/builder/command.rs index 4171a8e86bd..8fa413567ce 100644 --- a/tests/builder/command.rs +++ b/tests/builder/command.rs @@ -7,8 +7,7 @@ use crate::utils; static EVERYTHING: &str = "clap {{version}} A simple to use, efficient, and full-featured Command Line Argument Parser -Usage: - clap +Usage: clap Options: -h, --help Print help information diff --git a/tests/builder/conflicts.rs b/tests/builder/conflicts.rs index d7caffda746..f98d1fc215b 100644 --- a/tests/builder/conflicts.rs +++ b/tests/builder/conflicts.rs @@ -292,8 +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: - clap-test --flag... --long-option-2 [positional3]... +Usage: clap-test --flag... --long-option-2 [positional3]... For more information try --help "; @@ -310,8 +309,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: - clap-test -F --long-option-2 [positional3]... +Usage: clap-test -F --long-option-2 [positional3]... For more information try --help "; @@ -328,8 +326,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: - clap-test --flag... --long-option-2 [positional3]... +Usage: clap-test --flag... --long-option-2 [positional3]... For more information try --help "; @@ -346,8 +343,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: - clap-test -F --long-option-2 [positional3]... +Usage: clap-test -F --long-option-2 [positional3]... For more information try --help "; @@ -366,8 +362,7 @@ fn conflict_output_three_conflicting() { --two --three -Usage: - three_conflicting_arguments --one +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 3f04b6b9657..b62492c183f 100644 --- a/tests/builder/default_vals.rs +++ b/tests/builder/default_vals.rs @@ -731,8 +731,7 @@ fn default_vals_donnot_show_in_smart_usage() { "error: The following required arguments were not provided: -Usage: - bug +Usage: bug For more information try --help ", diff --git a/tests/builder/derive_order.rs b/tests/builder/derive_order.rs index 8514d473ac2..5f926efef37 100644 --- a/tests/builder/derive_order.rs +++ b/tests/builder/derive_order.rs @@ -7,8 +7,7 @@ use clap::{Arg, ArgAction, Command}; #[test] fn no_derive_order() { static NO_DERIVE_ORDER: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: --flag_a second flag @@ -47,8 +46,7 @@ Options: #[test] fn derive_order() { static UNIFIED_HELP_AND_DERIVE: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: --flag_b first flag @@ -84,8 +82,7 @@ Options: #[test] fn derive_order_next_order() { static HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: --flag_b first flag @@ -131,8 +128,7 @@ Options: #[test] fn derive_order_no_next_order() { static HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: --flag_a first flag @@ -177,8 +173,7 @@ Options: #[test] fn derive_order_subcommand_propagate() { static UNIFIED_DERIVE_SC_PROP: &str = "\ -Usage: - test sub [OPTIONS] +Usage: test sub [OPTIONS] Options: --flag_b first flag @@ -216,8 +211,7 @@ Options: #[test] fn derive_order_subcommand_propagate_with_explicit_display_order() { static UNIFIED_DERIVE_SC_PROP_EXPLICIT_ORDER: &str = "\ -Usage: - test sub [OPTIONS] +Usage: test sub [OPTIONS] Options: --flag_a second flag @@ -261,8 +255,7 @@ Options: #[test] fn subcommand_sorted_display_order() { static SUBCMD_ALPHA_ORDER: &str = "\ -Usage: - test [COMMAND] +Usage: test [COMMAND] Commands: a1 blah a1 @@ -297,8 +290,7 @@ Options: #[test] fn subcommand_derived_display_order() { static SUBCMD_DECL_ORDER: &str = "\ -Usage: - test [COMMAND] +Usage: test [COMMAND] Commands: b1 blah b1 diff --git a/tests/builder/display_order.rs b/tests/builder/display_order.rs index 73d2bf49efd..077b243ba3b 100644 --- a/tests/builder/display_order.rs +++ b/tests/builder/display_order.rs @@ -10,8 +10,7 @@ fn very_large_display_order() { cmd, "test --help", "\ -Usage: - test [COMMAND] +Usage: test [COMMAND] Commands: help Print this message or the help of the given subcommand(s) diff --git a/tests/builder/double_require.rs b/tests/builder/double_require.rs index 6c87a77557b..6200fc8e425 100644 --- a/tests/builder/double_require.rs +++ b/tests/builder/double_require.rs @@ -1,8 +1,7 @@ use clap::{error::ErrorKind, Arg, ArgAction, Command}; static HELP: &str = "\ -Usage: - prog [OPTIONS] +Usage: prog [OPTIONS] Options: -a @@ -14,8 +13,7 @@ Options: static ONLY_B_ERROR: &str = "error: The following required arguments were not provided: -c -Usage: - prog -b -c +Usage: prog -b -c For more information try --help "; @@ -23,8 +21,7 @@ For more information try --help static ONLY_C_ERROR: &str = "error: The following required arguments were not provided: -b -Usage: - prog -c -b +Usage: prog -c -b For more information try --help "; diff --git a/tests/builder/empty_values.rs b/tests/builder/empty_values.rs index 434f49762d1..ba338a764e5 100644 --- a/tests/builder/empty_values.rs +++ b/tests/builder/empty_values.rs @@ -118,8 +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: - config [OPTIONS] +Usage: config [OPTIONS] For more information try --help "; diff --git a/tests/builder/error.rs b/tests/builder/error.rs index 673dc1a7fc8..26344039bb1 100644 --- a/tests/builder/error.rs +++ b/tests/builder/error.rs @@ -25,8 +25,7 @@ fn assert_error( fn app_error() { static MESSAGE: &str = "error: Failed for mysterious reasons -Usage: - test [OPTIONS] --all +Usage: test [OPTIONS] --all For more information try --help "; @@ -89,8 +88,7 @@ fn null_prints_help() { let err = res.unwrap_err(); let expected_kind = ErrorKind::DisplayHelp; static MESSAGE: &str = "\ -Usage: - test +Usage: test Options: -h, --help Print help information @@ -108,8 +106,7 @@ fn raw_prints_help() { let err = res.unwrap_err(); let expected_kind = ErrorKind::DisplayHelp; static MESSAGE: &str = "\ -Usage: - test +Usage: test Options: -h, --help Print help information @@ -140,8 +137,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: - test +Usage: test For more information try --help "; @@ -161,8 +157,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: - test +Usage: test "; assert_error(err, expected_kind, MESSAGE, true); } diff --git a/tests/builder/flag_subcommands.rs b/tests/builder/flag_subcommands.rs index 0c8ead4ac99..e55afe08b12 100644 --- a/tests/builder/flag_subcommands.rs +++ b/tests/builder/flag_subcommands.rs @@ -499,8 +499,7 @@ fn flag_subcommand_long_infer_exact_match() { static FLAG_SUBCOMMAND_HELP: &str = "\ Query the package database. -Usage: - pacman {query|--query|-Q} [OPTIONS] +Usage: pacman {query|--query|-Q} [OPTIONS] Options: -s, --search ... search locally installed packages for matching strings @@ -548,8 +547,7 @@ fn flag_subcommand_long_short_normal_usage_string() { static FLAG_SUBCOMMAND_NO_SHORT_HELP: &str = "\ Query the package database. -Usage: - pacman {query|--query} [OPTIONS] +Usage: pacman {query|--query} [OPTIONS] Options: -s, --search ... search locally installed packages for matching strings @@ -601,8 +599,7 @@ fn flag_subcommand_long_normal_usage_string() { static FLAG_SUBCOMMAND_NO_LONG_HELP: &str = "\ Query the package database. -Usage: - pacman {query|-Q} [OPTIONS] +Usage: pacman {query|-Q} [OPTIONS] Options: -s, --search ... search locally installed packages for matching strings diff --git a/tests/builder/flags.rs b/tests/builder/flags.rs index 03e365f46bd..699d33e966d 100644 --- a/tests/builder/flags.rs +++ b/tests/builder/flags.rs @@ -6,8 +6,7 @@ const USE_FLAG_AS_ARGUMENT: &str = If you tried to supply `--another-flag` as a value rather than a flag, use `-- --another-flag` -Usage: - mycat [OPTIONS] [filename] +Usage: mycat [OPTIONS] [filename] For more information try --help "; @@ -183,8 +182,7 @@ fn issue_2308_multiple_dashes() { If you tried to supply `-----` as a value rather than a flag, use `-- -----` -Usage: - test +Usage: test For more information try --help "; diff --git a/tests/builder/groups.rs b/tests/builder/groups.rs index ec3b1ea4a12..1a62c6af009 100644 --- a/tests/builder/groups.rs +++ b/tests/builder/groups.rs @@ -5,8 +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: - clap-test +Usage: clap-test For more information try --help "; @@ -14,8 +13,7 @@ For more information try --help static REQ_GROUP_CONFLICT_USAGE: &str = "error: The argument '--delete' cannot be used with '[base]' -Usage: - clap-test +Usage: clap-test For more information try --help "; @@ -23,8 +21,7 @@ For more information try --help static REQ_GROUP_CONFLICT_ONLY_OPTIONS: &str = "error: The argument '--delete' cannot be used with '--all' -Usage: - clap-test <--all|--delete> +Usage: clap-test <--all|--delete> For more information try --help "; @@ -262,8 +259,7 @@ fn group_overrides_required() { #[test] fn group_usage_use_val_name() { static GROUP_USAGE_USE_VAL_NAME: &str = "\ -Usage: - prog +Usage: prog Arguments: [A] diff --git a/tests/builder/help.rs b/tests/builder/help.rs index 72e65e4ece9..44ee1a60c08 100644 --- a/tests/builder/help.rs +++ b/tests/builder/help.rs @@ -78,8 +78,7 @@ fn help_multi_subcommand_error() { static EXPECTED: &str = "error: The subcommand 'foo' wasn't recognized -Usage: - ctest subcmd multi [OPTIONS] +Usage: ctest subcmd multi [OPTIONS] For more information try --help "; @@ -89,8 +88,7 @@ For more information try --help #[test] fn req_last_arg_usage() { static LAST_ARG_REQ_MULT: &str = "\ -Usage: - example ... -- ... +Usage: example ... -- ... Arguments: ... First @@ -117,8 +115,7 @@ Options: #[test] fn args_with_last_usage() { static LAST_ARG_USAGE: &str = "\ -Usage: - flamegraph [OPTIONS] [BINFILE] [-- ...] +Usage: flamegraph [OPTIONS] [BINFILE] [-- ...] Arguments: [BINFILE] The path of the binary to be profiled. for a binary. @@ -202,8 +199,7 @@ clap-test v1.4.8 Kevin K. tests clap library -Usage: - clap-test [OPTIONS] [positional] [positional2] [positional3]... [COMMAND] +Usage: clap-test [OPTIONS] [positional] [positional2] [positional3]... [COMMAND] Commands: subcmd tests subcommands @@ -239,8 +235,7 @@ fn after_and_before_help_output() { tests clap library -Usage: - clap-test +Usage: clap-test Options: -h, --help Print help information @@ -264,8 +259,7 @@ fn after_and_before_long_help_output() { tests clap library -Usage: - clap-test +Usage: clap-test Options: -h, --help Print help information (use `--help` for more detail) @@ -278,8 +272,7 @@ some text that comes after the help tests clap library -Usage: - clap-test +Usage: clap-test Options: -h, --help @@ -305,8 +298,7 @@ some longer text that comes after the help static MULTI_SC_HELP: &str = "\ tests subcommands -Usage: - ctest subcmd multi [OPTIONS] +Usage: ctest subcmd multi [OPTIONS] Options: -f, --flag tests flags @@ -342,8 +334,7 @@ fn multi_level_sc_help() { #[test] fn no_wrap_default_help() { static DEFAULT_HELP: &str = "\ -Usage: - ctest +Usage: ctest Options: -h, --help Print help information @@ -358,8 +349,7 @@ Options: #[cfg(feature = "wrap_help")] fn wrapped_help() { static WRAPPED_HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -a, --all @@ -413,8 +403,7 @@ Options: #[cfg(feature = "wrap_help")] fn unwrapped_help() { static UNWRAPPED_HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -a, --all Also do versioning for private crates @@ -460,8 +449,7 @@ Options: #[cfg(all(feature = "wrap_help"))] fn possible_value_wrapped_help() { static WRAPPED_HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: --possible-values @@ -527,8 +515,7 @@ fn complex_subcommand_help_output() { Kevin K. tests subcommands -Usage: - clap-test subcmd [OPTIONS] [scpositional] +Usage: clap-test subcmd [OPTIONS] [scpositional] Arguments: [scpositional] tests positionals @@ -548,8 +535,7 @@ Options: #[test] fn issue_626_unicode_cutoff() { static ISSUE_626_CUTOFF: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -c, --cafe A coffeehouse, coffee shop, or café is an @@ -583,8 +569,7 @@ Options: } static HIDE_POS_VALS: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -p, --pos Some vals [possible values: fast, slow] @@ -650,8 +635,7 @@ fn hide_single_possible_val() { #[test] fn possible_vals_with_help() { static POS_VALS_HELP: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -p, --pos @@ -699,8 +683,7 @@ Options: #[test] fn issue_626_panic() { static ISSUE_626_PANIC: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -c, --cafe @@ -754,8 +737,7 @@ fn issue_626_variable_panic() { #[test] fn final_word_wrapping() { static FINAL_WORD_WRAPPING: &str = "\ -Usage: - ctest +Usage: ctest Options: -h, --help @@ -773,8 +755,7 @@ Options: } static WRAPPING_NEWLINE_CHARS: &str = "\ -Usage: - ctest [mode] +Usage: ctest [mode] Arguments: [mode] x, max, maximum 20 characters, contains @@ -827,8 +808,7 @@ fn dont_wrap_urls() { ); const EXPECTED: &str = "\ -Usage: - Example update [OPTIONS] +Usage: Example update [OPTIONS] Options: --force-non-host @@ -845,8 +825,7 @@ Options: } static OLD_NEWLINE_CHARS: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -m Some help with some wrapping @@ -880,8 +859,7 @@ fn old_newline_variables() { #[test] fn issue_688_hide_pos_vals() { static ISSUE_688: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: --filter Sets the filter, or sampling method, to use for interpolation when resizing the particle @@ -932,8 +910,7 @@ fn issue_702_multiple_values() { static ISSUE_702: &str = "\ bar -Usage: - myapp [OPTIONS] [arg1] [arg2]... +Usage: myapp [OPTIONS] [arg1] [arg2]... Arguments: [arg1] some option @@ -990,8 +967,7 @@ something really really long, with multiple lines of text that should be displayed -Usage: - myapp [arg1] +Usage: myapp [arg1] Arguments: [arg1] @@ -1019,11 +995,10 @@ Options: #[test] fn ripgrep_usage() { static RIPGREP_USAGE: &str = "\ -Usage: - rg [OPTIONS] [ ...] - rg [OPTIONS] [-e PATTERN | -f FILE ]... [ ...] - rg [OPTIONS] --files [ ...] - rg [OPTIONS] --type-list +Usage: rg [OPTIONS] [ ...] + rg [OPTIONS] [-e PATTERN | -f FILE ]... [ ...] + rg [OPTIONS] --files [ ...] + rg [OPTIONS] --type-list Options: -h, --help Print help information @@ -1032,9 +1007,9 @@ Options: let cmd = Command::new("ripgrep").version("0.5").override_usage( "rg [OPTIONS] [ ...] - rg [OPTIONS] [-e PATTERN | -f FILE ]... [ ...] - rg [OPTIONS] --files [ ...] - rg [OPTIONS] --type-list", + rg [OPTIONS] [-e PATTERN | -f FILE ]... [ ...] + rg [OPTIONS] --files [ ...] + rg [OPTIONS] --type-list", ); utils::assert_output(cmd, "rg --help", RIPGREP_USAGE, false); @@ -1045,11 +1020,10 @@ fn ripgrep_usage_using_templates() { static RIPGREP_USAGE: &str = "\ ripgrep 0.5 -Usage: - rg [OPTIONS] [ ...] - rg [OPTIONS] [-e PATTERN | -f FILE ]... [ ...] - rg [OPTIONS] --files [ ...] - rg [OPTIONS] --type-list +Usage: rg [OPTIONS] [ ...] + rg [OPTIONS] [-e PATTERN | -f FILE ]... [ ...] + rg [OPTIONS] --files [ ...] + rg [OPTIONS] --type-list Options: -h, --help Print help information @@ -1059,17 +1033,17 @@ Options: let cmd = Command::new("ripgrep") .version("0.5") .override_usage( - " - rg [OPTIONS] [ ...] - rg [OPTIONS] [-e PATTERN | -f FILE ]... [ ...] - rg [OPTIONS] --files [ ...] - rg [OPTIONS] --type-list", + "\ + rg [OPTIONS] [ ...] + rg [OPTIONS] [-e PATTERN | -f FILE ]... [ ...] + rg [OPTIONS] --files [ ...] + rg [OPTIONS] --type-list", ) .help_template( "\ {bin} {version} -Usage:{usage} +Usage: {usage} Options: {options}", @@ -1081,9 +1055,8 @@ Options: #[test] fn sc_negates_reqs() { static SC_NEGATES_REQS: &str = "\ -Usage: - prog --opt [PATH] - prog [PATH] +Usage: prog --opt [PATH] + prog [PATH] Commands: test @@ -1110,8 +1083,7 @@ Options: #[test] fn hide_args() { static HIDDEN_ARGS: &str = "\ -Usage: - prog [OPTIONS] +Usage: prog [OPTIONS] Options: -f, --flag testing flags @@ -1131,9 +1103,8 @@ Options: #[test] fn args_negate_sc() { static ARGS_NEGATE_SC: &str = "\ -Usage: - prog [OPTIONS] [PATH] - prog +Usage: prog [OPTIONS] [PATH] + prog Commands: test @@ -1162,8 +1133,7 @@ Options: #[test] fn issue_1046_hide_scs() { static ISSUE_1046_HIDDEN_SCS: &str = "\ -Usage: - prog [OPTIONS] [PATH] +Usage: prog [OPTIONS] [PATH] Arguments: [PATH] some @@ -1193,8 +1163,7 @@ email Show how the about text is not wrapped -Usage: - ctest +Usage: ctest Options: -h, --help @@ -1215,8 +1184,7 @@ Options: } static OVERRIDE_HELP_SHORT: &str = "\ -Usage: - test +Usage: test Options: -H, --help Print help information @@ -1235,8 +1203,7 @@ fn override_help_short() { } static OVERRIDE_HELP_LONG: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -h, --hell Print help information @@ -1255,8 +1222,7 @@ fn override_help_long() { } static OVERRIDE_HELP_ABOUT: &str = "\ -Usage: - test +Usage: test Options: -h, --help Print custom help information @@ -1308,8 +1274,7 @@ fn arg_long_conflict_with_help() { #[test] fn last_arg_mult_usage() { static LAST_ARG: &str = "\ -Usage: - last [CORPUS] [-- ...] +Usage: last [CORPUS] [-- ...] Arguments: some @@ -1338,8 +1303,7 @@ Options: #[test] fn last_arg_mult_usage_req() { static LAST_ARG_REQ: &str = "\ -Usage: - last [CORPUS] -- ... +Usage: last [CORPUS] -- ... Arguments: some @@ -1369,9 +1333,8 @@ Options: #[test] fn last_arg_mult_usage_req_with_sc() { static LAST_ARG_REQ_SC: &str = "\ -Usage: - last [CORPUS] -- ... - last [TARGET] [CORPUS] +Usage: last [CORPUS] -- ... + last [TARGET] [CORPUS] Commands: test some @@ -1407,9 +1370,8 @@ Options: #[test] fn last_arg_mult_usage_with_sc() { static LAST_ARG_SC: &str = "\ -Usage: - last [CORPUS] [-- ...] - last +Usage: last [CORPUS] [-- ...] + last Commands: test some @@ -1442,8 +1404,7 @@ Options: } static HIDE_DEFAULT_VAL: &str = "\ -Usage: - default [OPTIONS] +Usage: default [OPTIONS] Options: --arg Pass an argument to the program. [default: default-argument] @@ -1474,8 +1435,7 @@ fn hide_default_val() { #[test] fn escaped_whitespace_values() { static ESCAPED_DEFAULT_VAL: &str = "\ -Usage: - default [OPTIONS] +Usage: default [OPTIONS] Options: --arg Pass an argument to the program. [default: \"\\n\"] [possible values: normal, \" \", \"\\n\", \"\\t\", @@ -1565,8 +1525,7 @@ fn issue_1052_require_delim_help() { static REQUIRE_DELIM_HELP: &str = "\ tests stuff -Usage: - test --fake +Usage: test --fake Options: -f, --fake some help @@ -1594,8 +1553,7 @@ fn custom_headers_headers() { static CUSTOM_HELP_SECTION: &str = "\ does stuff -Usage: - test [OPTIONS] --fake +Usage: test [OPTIONS] --fake Options: -f, --fake some help @@ -1634,8 +1592,7 @@ NETWORKING: static MULTIPLE_CUSTOM_HELP_SECTIONS: &str = "\ does stuff -Usage: - test [OPTIONS] --fake --birthday-song --birthday-song-volume +Usage: test [OPTIONS] --fake --birthday-song --birthday-song-volume Options: -f, --fake some help @@ -1714,8 +1671,7 @@ fn multiple_custom_help_headers() { static CUSTOM_HELP_SECTION_HIDDEN_ARGS: &str = "\ does stuff -Usage: - test [OPTIONS] --song --song-volume +Usage: test [OPTIONS] --song --song-volume Options: -h, --help Print help information (use `--help` for more detail) @@ -1766,8 +1722,7 @@ fn custom_help_headers_hide_args() { static ISSUE_897: &str = "\ Long about foo -Usage: - ctest foo +Usage: ctest foo Options: -h, --help @@ -1791,8 +1746,7 @@ fn show_long_about_issue_897() { static ISSUE_897_SHORT: &str = "\ About foo -Usage: - ctest foo +Usage: ctest foo Options: -h, --help Print help information (use `--help` for more detail) @@ -1813,8 +1767,7 @@ fn show_short_about_issue_897() { #[test] fn issue_1364_no_short_options() { static ISSUE_1364: &str = "\ -Usage: - demo [OPTIONS] [FILES]... +Usage: demo [OPTIONS] [FILES]... Arguments: [FILES]... @@ -1846,8 +1799,7 @@ Options: #[test] fn issue_1487() { static ISSUE_1487: &str = "\ -Usage: - ctest +Usage: ctest Arguments: [arg1] @@ -1967,8 +1919,7 @@ fn help_required_and_no_args() { #[test] fn issue_1642_long_help_spacing() { static ISSUE_1642: &str = "\ -Usage: - prog [OPTIONS] +Usage: prog [OPTIONS] Options: --config @@ -1996,8 +1947,7 @@ and on, so I'll stop now.", } const AFTER_HELP_NO_ARGS: &str = "\ -Usage: - myapp +Usage: myapp This is after help. "; @@ -2024,8 +1974,7 @@ fn help_subcmd_help() { static HELP_SUBCMD_HELP: &str = "\ Print this message or the help of the given subcommand(s) -Usage: - myapp help [COMMAND]... +Usage: myapp help [COMMAND]... Arguments: [COMMAND]... The subcommand whose help message to display @@ -2042,8 +1991,7 @@ fn subcmd_help_subcmd_help() { static SUBCMD_HELP_SUBCMD_HELP: &str = "\ Print this message or the help of the given subcommand(s) -Usage: - myapp subcmd help [COMMAND]... +Usage: myapp subcmd help [COMMAND]... Arguments: [COMMAND]... The subcommand whose help message to display @@ -2063,8 +2011,7 @@ Arguments: #[test] fn global_args_should_show_on_toplevel_help_message() { static HELP: &str = "\ -Usage: - myapp [OPTIONS] [COMMAND] +Usage: myapp [OPTIONS] [COMMAND] Commands: subcmd\x20\x20\x20\x20 @@ -2092,8 +2039,7 @@ fn global_args_should_not_show_on_help_message_for_help_help() { static HELP_HELP: &str = "\ Print this message or the help of the given subcommand(s) -Usage: - myapp help [COMMAND]... +Usage: myapp help [COMMAND]... Arguments: [COMMAND]... The subcommand whose help message to display @@ -2114,8 +2060,7 @@ Arguments: #[test] fn global_args_should_show_on_help_message_for_subcommand() { static HELP_SUBCMD: &str = "\ -Usage: - myapp subcmd [OPTIONS] [COMMAND] +Usage: myapp subcmd [OPTIONS] [COMMAND] Commands: multi\x20\x20\x20\x20 @@ -2141,8 +2086,7 @@ Options: #[test] fn global_args_should_show_on_help_message_for_nested_subcommand() { static HELP_SUB_SUBCMD: &str = "\ -Usage: - myapp subcmd multi [OPTIONS] +Usage: myapp subcmd multi [OPTIONS] Options: -g, --some-global \x20\x20\x20\x20 @@ -2165,8 +2109,7 @@ Options: #[test] fn option_usage_order() { static OPTION_USAGE_ORDER: &str = "\ -Usage: - order [OPTIONS] +Usage: order [OPTIONS] Options: -a @@ -2199,8 +2142,7 @@ Options: #[test] fn prefer_about_over_long_about_in_subcommands_list() { static ABOUT_IN_COMMANDS_LIST: &str = "\ -Usage: - about-in-subcommands-list [COMMAND] +Usage: about-in-subcommands-list [COMMAND] Commands: sub short about sub @@ -2227,8 +2169,7 @@ Options: #[test] fn issue_1794_usage() { static USAGE_WITH_GROUP: &str = "\ -Usage: - deno [pos2] +Usage: deno [pos2] Arguments: [pos1] @@ -2258,8 +2199,7 @@ Options: } static CUSTOM_HEADING_POS: &str = "\ -Usage: - test [gear] [speed] +Usage: test [gear] [speed] Arguments: [gear] Which gear @@ -2284,8 +2224,7 @@ fn custom_heading_pos() { } static ONLY_CUSTOM_HEADING_OPTS_NO_ARGS: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] NETWORKING: -s, --speed How fast @@ -2305,8 +2244,7 @@ fn only_custom_heading_opts_no_args() { } static ONLY_CUSTOM_HEADING_POS_NO_ARGS: &str = "\ -Usage: - test [speed] +Usage: test [speed] NETWORKING: [speed] How fast @@ -2339,8 +2277,7 @@ fn issue_2508_number_of_values_with_single_value_name() { cmd, "my_app --help", "\ -Usage: - my_app [OPTIONS] +Usage: my_app [OPTIONS] Options: --some_arg @@ -2361,8 +2298,7 @@ fn missing_positional_final_required() { cmd, "test --help", "\ -Usage: - test [arg1] +Usage: test [arg1] Arguments: [arg1] @@ -2386,8 +2322,7 @@ fn missing_positional_final_multiple() { cmd, "test --help", "\ -Usage: - test [foo] [bar] [baz]... +Usage: test [foo] [bar] [baz]... Arguments: [foo] @@ -2413,8 +2348,7 @@ fn positional_multiple_values_is_dotted() { cmd, "test --help", "\ -Usage: - test ... +Usage: test ... Arguments: ... @@ -2436,8 +2370,7 @@ Options: cmd, "test --help", "\ -Usage: - test ... +Usage: test ... Arguments: ... @@ -2462,8 +2395,7 @@ fn positional_multiple_occurrences_is_dotted() { cmd, "test --help", "\ -Usage: - test ... +Usage: test ... Arguments: ... @@ -2486,8 +2418,7 @@ Options: cmd, "test --help", "\ -Usage: - test ... +Usage: test ... Arguments: ... @@ -2513,8 +2444,7 @@ fn too_few_value_names_is_dotted() { cmd, "test --help", "\ -Usage: - test --foo ... +Usage: test --foo ... Options: --foo ... @@ -2616,8 +2546,7 @@ fn subcommand_help_doesnt_have_useless_help_flag() { "\ Print this message or the help of the given subcommand(s) -Usage: - example help [COMMAND]... +Usage: example help [COMMAND]... Arguments: [COMMAND]... The subcommand whose help message to display @@ -2659,8 +2588,7 @@ fn dont_propagate_version_to_help_subcommand() { "\ Print this message or the help of the given subcommand(s) -Usage: - example help [COMMAND]... +Usage: example help [COMMAND]... Arguments: [COMMAND]... The subcommand whose help message to display @@ -2694,8 +2622,7 @@ fn parent_cmd_req_in_usage_with_help_flag() { static EXPECTED: &str = "\ some -Usage: - parent test +Usage: parent test Options: -h, --help Print help information @@ -2718,8 +2645,7 @@ fn parent_cmd_req_in_usage_with_help_subcommand() { static EXPECTED: &str = "\ some -Usage: - parent test +Usage: parent test Options: -h, --help Print help information @@ -2742,8 +2668,7 @@ fn parent_cmd_req_in_usage_with_render_help() { static EXPECTED: &str = "\ some -Usage: - parent test +Usage: parent test Options: -h, --help Print help information @@ -2769,8 +2694,7 @@ Options: #[test] fn parent_cmd_req_ignored_when_negates_reqs() { static MULTI_SC_HELP: &str = "\ -Usage: - ctest subcmd +Usage: ctest subcmd Options: -h, --help Print help information @@ -2786,8 +2710,7 @@ Options: #[test] fn parent_cmd_req_ignored_when_conflicts() { static MULTI_SC_HELP: &str = "\ -Usage: - ctest subcmd +Usage: ctest subcmd Options: -h, --help Print help information diff --git a/tests/builder/help_env.rs b/tests/builder/help_env.rs index fd7faba9dbd..5f715ce0338 100644 --- a/tests/builder/help_env.rs +++ b/tests/builder/help_env.rs @@ -7,8 +7,7 @@ use clap::{Arg, ArgAction, Command}; use super::utils; static HIDE_ENV: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -c, --cafe A coffeehouse, coffee shop, or café. @@ -17,8 +16,7 @@ Options: "; static SHOW_ENV: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -c, --cafe A coffeehouse, coffee shop, or café. [env: ENVVAR=MYVAL] @@ -27,8 +25,7 @@ Options: "; static HIDE_ENV_VALS: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -c, --cafe A coffeehouse, coffee shop, or café. [env: ENVVAR] @@ -37,8 +34,7 @@ Options: "; static SHOW_ENV_VALS: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -c, --cafe A coffeehouse, coffee shop, or café. [env: ENVVAR=MYVAL] @@ -47,8 +43,7 @@ Options: "; static HIDE_ENV_FLAG: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -c, --cafe A coffeehouse, coffee shop, or café. @@ -57,8 +52,7 @@ Options: "; static SHOW_ENV_FLAG: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -c, --cafe A coffeehouse, coffee shop, or café. [env: ENVVAR=MYVAL] @@ -67,8 +61,7 @@ Options: "; static HIDE_ENV_VALS_FLAG: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -c, --cafe A coffeehouse, coffee shop, or café. [env: ENVVAR] @@ -77,8 +70,7 @@ Options: "; static SHOW_ENV_VALS_FLAG: &str = "\ -Usage: - ctest [OPTIONS] +Usage: ctest [OPTIONS] Options: -c, --cafe A coffeehouse, coffee shop, or café. [env: ENVVAR=MYVAL] diff --git a/tests/builder/hidden_args.rs b/tests/builder/hidden_args.rs index 96d40bd117a..75a0591cef5 100644 --- a/tests/builder/hidden_args.rs +++ b/tests/builder/hidden_args.rs @@ -5,8 +5,7 @@ use clap::{arg, Arg, ArgAction, Command}; static HIDDEN_ARGS: &str = "\ tests stuff -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -F, --flag2 some other flag @@ -33,8 +32,7 @@ fn hide_args() { static HIDDEN_SHORT_ARGS: &str = "\ hides short args -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -v, --visible This text should be visible @@ -72,8 +70,7 @@ fn hide_short_args_long_help() { static HIDDEN_SHORT_ARGS_LONG_HELP: &str = "\ hides short args -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -c, --config @@ -113,8 +110,7 @@ Options: static HIDDEN_LONG_ARGS: &str = "\ hides long args -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -v, --visible @@ -153,8 +149,7 @@ fn hide_long_args() { static HIDDEN_LONG_ARGS_SHORT_HELP: &str = "\ hides long args -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -c, --config Some help text describing the --config arg @@ -187,8 +182,7 @@ fn hide_long_args_short_help() { } static HIDDEN_POS_ARGS: &str = "\ -Usage: - test [another] +Usage: test [another] Arguments: [another] another pos @@ -209,8 +203,7 @@ fn hide_pos_args() { } static HIDDEN_SUBCMDS: &str = "\ -Usage: - test +Usage: test Options: -h, --help Print help information @@ -227,8 +220,7 @@ fn hide_subcmds() { } static HIDDEN_OPT_ARGS_ONLY: &str = "\ -Usage: - test +Usage: test After help "; @@ -252,8 +244,7 @@ fn hide_opt_args_only() { } static HIDDEN_POS_ARGS_ONLY: &str = "\ -Usage: - test +Usage: test After help "; @@ -273,8 +264,7 @@ fn hide_pos_args_only() { } static HIDDEN_SUBCMDS_ONLY: &str = "\ -Usage: - test +Usage: test After help "; diff --git a/tests/builder/multiple_values.rs b/tests/builder/multiple_values.rs index 0ba475ba85a..f1c927dcb65 100644 --- a/tests/builder/multiple_values.rs +++ b/tests/builder/multiple_values.rs @@ -429,8 +429,7 @@ fn optional_value() { let mut help = Vec::new(); cmd.write_help(&mut help).unwrap(); const HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -p [] diff --git a/tests/builder/opts.rs b/tests/builder/opts.rs index c1084e0c71c..ed813deebe5 100644 --- a/tests/builder/opts.rs +++ b/tests/builder/opts.rs @@ -10,8 +10,7 @@ static DYM: &str = If you tried to supply `--optio` as a value rather than a flag, use `-- --optio` -Usage: - clap-test --option ... [positional] [positional2] [positional3]... +Usage: clap-test --option ... [positional] [positional2] [positional3]... For more information try --help "; @@ -24,8 +23,7 @@ static DYM_ISSUE_1073: &str = If you tried to supply `--files-without-matches` as a value rather than a flag, use `-- --files-without-matches` -Usage: - ripgrep-616 --files-without-match +Usage: ripgrep-616 --files-without-match For more information try --help "; @@ -50,8 +48,7 @@ fn require_equals_fail_message() { static NO_EQUALS: &str = "error: Equal sign is needed when assigning values to '--config='. -Usage: - prog [OPTIONS] +Usage: prog [OPTIONS] For more information try --help "; diff --git a/tests/builder/positionals.rs b/tests/builder/positionals.rs index 072770fa18e..443afceaa01 100644 --- a/tests/builder/positionals.rs +++ b/tests/builder/positionals.rs @@ -211,13 +211,13 @@ fn positional_hyphen_does_not_panic() { #[test] fn single_positional_usage_string() { let mut cmd = Command::new("test").arg(arg!([FILE] "some file")); - crate::utils::assert_eq(cmd.render_usage(), "Usage:\n test [FILE]"); + crate::utils::assert_eq(cmd.render_usage(), "Usage: test [FILE]"); } #[test] fn single_positional_multiple_usage_string() { let mut cmd = Command::new("test").arg(arg!([FILE]... "some file")); - crate::utils::assert_eq(cmd.render_usage(), "Usage:\n test [FILE]..."); + crate::utils::assert_eq(cmd.render_usage(), "Usage: test [FILE]..."); } #[test] @@ -228,8 +228,7 @@ fn multiple_positional_usage_string() { crate::utils::assert_eq( cmd.render_usage(), "\ -Usage: - test [FILE] [FILES]...", +Usage: test [FILE] [FILES]...", ); } @@ -238,13 +237,13 @@ fn multiple_positional_one_required_usage_string() { let mut cmd = Command::new("test") .arg(arg!( "some file")) .arg(arg!([FILES]... "some file")); - crate::utils::assert_eq(cmd.render_usage(), "Usage:\n test [FILES]..."); + crate::utils::assert_eq(cmd.render_usage(), "Usage: test [FILES]..."); } #[test] fn single_positional_required_usage_string() { let mut cmd = Command::new("test").arg(arg!( "some file")); - crate::utils::assert_eq(cmd.render_usage(), "Usage:\n test "); + crate::utils::assert_eq(cmd.render_usage(), "Usage: test "); } // This tests a programmer error and will only succeed with debug_assertions diff --git a/tests/builder/require.rs b/tests/builder/require.rs index bcaa6a0ed9c..653d7c4b1a8 100644 --- a/tests/builder/require.rs +++ b/tests/builder/require.rs @@ -6,8 +6,7 @@ use clap::{arg, error::ErrorKind, Arg, ArgAction, ArgGroup, Command}; static REQUIRE_EQUALS: &str = "error: The following required arguments were not provided: --opt= -Usage: - clap-test --opt= +Usage: clap-test --opt= For more information try --help "; @@ -15,8 +14,7 @@ For more information try --help static REQUIRE_EQUALS_FILTERED: &str = "error: The following required arguments were not provided: --opt= -Usage: - clap-test --opt= --foo= +Usage: clap-test --opt= --foo= For more information try --help "; @@ -25,8 +23,7 @@ static REQUIRE_EQUALS_FILTERED_GROUP: &str = "error: The following required arguments were not provided: --opt= -Usage: - clap-test --opt= --foo= <--g1=|--g2=> +Usage: clap-test --opt= --foo= <--g1=|--g2=> For more information try --help "; @@ -36,8 +33,7 @@ static MISSING_REQ: &str = "error: The following required arguments were not pro -Usage: - clap-test --long-option-2 -F [positional3]... +Usage: clap-test --long-option-2 -F [positional3]... For more information try --help "; @@ -45,8 +41,7 @@ For more information try --help static COND_REQ_IN_USAGE: &str = "error: The following required arguments were not provided: --output -Usage: - test --target --input --output +Usage: test --target --input --output For more information try --help "; @@ -141,8 +136,7 @@ static POSITIONAL_REQ: &str = "error: The following required arguments were not -Usage: - clap-test [bar] +Usage: clap-test [bar] For more information try --help "; @@ -160,8 +154,7 @@ fn positional_required_with_requires_if_no_value() { static POSITIONAL_REQ_IF_NO_VAL: &str = "error: The following required arguments were not provided: -Usage: - clap-test [opt] [bar] +Usage: clap-test [opt] [bar] For more information try --help "; @@ -181,8 +174,7 @@ static POSITIONAL_REQ_IF_VAL: &str = "error: The following required arguments we -Usage: - clap-test [bar] +Usage: clap-test [bar] For more information try --help "; @@ -1031,8 +1023,7 @@ static ISSUE_1158: &str = "error: The following required arguments were not prov -y -z -Usage: - example -x -y -z +Usage: example -x -y -z For more information try --help "; @@ -1067,8 +1058,7 @@ fn multiple_required_unless_usage_printing() { --a --b -Usage: - test --c --a --b +Usage: test --c --a --b For more information try --help "; @@ -1435,8 +1425,7 @@ fn required_error_doesnt_duplicate() { const EXPECTED: &str = "\ error: The argument '-b ' cannot be used with '-c ' -Usage: - clap-test -b +Usage: clap-test -b For more information try --help "; @@ -1458,8 +1447,7 @@ fn required_require_with_group_shows_flag() { error: The following required arguments were not provided: --first -Usage: - test --require-first <--first|--second> +Usage: test --require-first <--first|--second> For more information try --help "; diff --git a/tests/builder/subcommands.rs b/tests/builder/subcommands.rs index f78286c298e..69625202196 100644 --- a/tests/builder/subcommands.rs +++ b/tests/builder/subcommands.rs @@ -3,8 +3,7 @@ use super::utils; use clap::{arg, error::ErrorKind, Arg, ArgAction, Command}; static VISIBLE_ALIAS_HELP: &str = "\ -Usage: - clap-test [COMMAND] +Usage: clap-test [COMMAND] Commands: test Some help [aliases: dongle, done] @@ -16,8 +15,7 @@ Options: "; static INVISIBLE_ALIAS_HELP: &str = "\ -Usage: - clap-test [COMMAND] +Usage: clap-test [COMMAND] Commands: test Some help @@ -35,8 +33,7 @@ static DYM_SUBCMD: &str = "error: The subcommand 'subcm' wasn't recognized If you believe you received this message in error, try re-running with 'dym -- subcm' -Usage: - dym [COMMAND] +Usage: dym [COMMAND] For more information try --help "; @@ -48,8 +45,7 @@ static DYM_SUBCMD_AMBIGUOUS: &str = "error: The subcommand 'te' wasn't recognize If you believe you received this message in error, try re-running with 'dym -- te' -Usage: - dym [COMMAND] +Usage: dym [COMMAND] For more information try --help "; @@ -59,8 +55,7 @@ static SUBCMD_AFTER_DOUBLE_DASH: &str = If you tried to supply `subcmd` as a subcommand, remove the '--' before it. -Usage: - cmd [COMMAND] +Usage: cmd [COMMAND] For more information try --help "; @@ -181,8 +176,7 @@ fn subcmd_did_you_mean_output_arg() { If you tried to supply `--subcmarg` as a value rather than a flag, use `-- --subcmarg` -Usage: - dym [COMMAND] +Usage: dym [COMMAND] For more information try --help "; @@ -202,8 +196,7 @@ fn subcmd_did_you_mean_output_arg_false_positives() { If you tried to supply `--subcmarg` as a value rather than a flag, use `-- --subcmarg` -Usage: - dym [COMMAND] +Usage: dym [COMMAND] For more information try --help "; @@ -356,7 +349,7 @@ fn subcommand_placeholder_test() { .subcommand_value_name("TEST_PLACEHOLDER") .subcommand_help_heading("TEST_HEADER"); - assert_eq!(&cmd.render_usage(), "Usage:\n myprog [TEST_PLACEHOLDER]"); + assert_eq!(&cmd.render_usage(), "Usage: myprog [TEST_PLACEHOLDER]"); let mut help_text = Vec::new(); cmd.write_help(&mut help_text) @@ -438,8 +431,7 @@ fn subcommand_not_recognized() { "fake help", "error: The subcommand 'help' wasn't recognized -Usage: - fake [COMMAND] +Usage: fake [COMMAND] For more information try --help ", @@ -515,8 +507,7 @@ fn bad_multicall_command_error() { static HELLO_EXPECTED: &str = "\ error: The subcommand 'world' wasn't recognized -Usage: - +Usage: For more information try help "; @@ -533,8 +524,7 @@ error: The subcommand 'baz' wasn't recognized If you believe you received this message in error, try re-running with ' -- baz' -Usage: - +Usage: For more information try help "; @@ -572,8 +562,7 @@ fn cant_have_args_with_multicall() { #[test] fn multicall_help_flag() { static EXPECTED: &str = "\ -Usage: - foo bar [value] +Usage: foo bar [value] Arguments: [value] @@ -593,8 +582,7 @@ Options: #[test] fn multicall_help_subcommand() { static EXPECTED: &str = "\ -Usage: - foo bar [value] +Usage: foo bar [value] Arguments: [value] @@ -614,8 +602,7 @@ Options: #[test] fn multicall_render_help() { static EXPECTED: &str = "\ -Usage: - foo bar [value] +Usage: foo bar [value] Arguments: [value] diff --git a/tests/builder/template_help.rs b/tests/builder/template_help.rs index de9e450b5a8..1dd4e103608 100644 --- a/tests/builder/template_help.rs +++ b/tests/builder/template_help.rs @@ -6,8 +6,7 @@ static EXAMPLE1_TMPL_S: &str = "{bin} {version} {author} {about} -Usage: - {usage} +Usage: {usage} {all-args}"; @@ -15,8 +14,7 @@ static EXAMPLE1_TMPS_F: &str = "{bin} {version} {author} {about} -Usage: - {usage} +Usage: {usage} Options: {options} @@ -29,8 +27,7 @@ static CUSTOM_TEMPL_HELP: &str = "MyApp 1.0 Kevin K. Does awesome things -Usage: - MyApp [OPTIONS] [COMMAND] +Usage: MyApp [OPTIONS] [COMMAND] Options: -c, --config Sets a custom config file @@ -48,8 +45,7 @@ static SIMPLE_TEMPLATE: &str = "MyApp 1.0 Kevin K. Does awesome things -Usage: - MyApp [OPTIONS] [COMMAND] +Usage: MyApp [OPTIONS] [COMMAND] Commands: test does testing things diff --git a/tests/builder/utils.rs b/tests/builder/utils.rs index 70a6815c6d6..3430e7164e9 100644 --- a/tests/builder/utils.rs +++ b/tests/builder/utils.rs @@ -8,8 +8,7 @@ use clap::{arg, Arg, ArgAction, ArgGroup, Command}; pub const FULL_TEMPLATE: &str = "\ {before-help}{name} {version} {author-with-newline}{about-with-newline} -{usage-heading} -{tab}{usage} +{usage-heading} {usage} {all-args}{after-help}"; diff --git a/tests/builder/version.rs b/tests/builder/version.rs index bd38f3c7c74..57915112bbf 100644 --- a/tests/builder/version.rs +++ b/tests/builder/version.rs @@ -105,8 +105,7 @@ fn help_short_flag_no_version() { static EXPECTED: &str = "\ foo -Usage: - foo +Usage: foo Options: -h, --help Print help information @@ -120,8 +119,7 @@ fn help_long_flag_no_version() { static EXPECTED: &str = "\ foo -Usage: - foo +Usage: foo Options: -h, --help Print help information @@ -135,8 +133,7 @@ fn help_short_flag_with_version() { static EXPECTED: &str = "\ foo 3.0 -Usage: - foo +Usage: foo Options: -h, --help Print help information @@ -151,8 +148,7 @@ fn help_long_flag_with_version() { static EXPECTED: &str = "\ foo 3.0 -Usage: - foo +Usage: foo Options: -h, --help Print help information @@ -167,8 +163,7 @@ fn help_short_flag_with_long_version() { static EXPECTED: &str = "\ foo 3.0 (abcdefg) -Usage: - foo +Usage: foo Options: -h, --help Print help information @@ -183,8 +178,7 @@ fn help_long_flag_with_long_version() { static EXPECTED: &str = "\ foo 3.0 (abcdefg) -Usage: - foo +Usage: foo Options: -h, --help Print help information @@ -199,8 +193,7 @@ fn help_short_flag_with_both() { static EXPECTED: &str = "\ foo 3.0 -Usage: - foo +Usage: foo Options: -h, --help Print help information @@ -215,8 +208,7 @@ fn help_long_flag_with_both() { static EXPECTED: &str = "\ foo 3.0 -Usage: - foo +Usage: foo Options: -h, --help Print help information diff --git a/tests/derive/help.rs b/tests/derive/help.rs index af2600d1785..91ac4e83302 100644 --- a/tests/derive/help.rs +++ b/tests/derive/help.rs @@ -220,9 +220,8 @@ fn derive_generated_error_has_full_context() { let expected = r#"error: The following required argument was not provided: req_str -Usage: - clap --req-str - clap +Usage: clap --req-str + clap For more information try --help "#; @@ -232,8 +231,7 @@ For more information try --help #[test] fn derive_order_next_order() { static HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: --flag-b first flag @@ -287,8 +285,7 @@ Options: #[test] fn derive_order_next_order_flatten() { static HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: --flag-b first flag @@ -342,8 +339,7 @@ Options: #[test] fn derive_order_no_next_order() { static HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: --flag-a first flag @@ -398,8 +394,7 @@ fn derive_possible_value_help() { static HELP: &str = "\ Application help -Usage: - clap +Usage: clap Arguments: diff --git a/tests/derive/utils.rs b/tests/derive/utils.rs index 9819b409446..9978bbe6c71 100644 --- a/tests/derive/utils.rs +++ b/tests/derive/utils.rs @@ -10,8 +10,7 @@ use clap::CommandFactory; pub const FULL_TEMPLATE: &str = "\ {before-help}{name} {version} {author-with-newline}{about-with-newline} -{usage-heading} -{tab}{usage} +{usage-heading} {usage} {all-args}{after-help}"; diff --git a/tests/macros.rs b/tests/macros.rs index f8324552008..b1850b26a1d 100644 --- a/tests/macros.rs +++ b/tests/macros.rs @@ -301,8 +301,7 @@ mod arg { let mut help = Vec::new(); cmd.write_help(&mut help).unwrap(); const HELP: &str = "\ -Usage: - test [OPTIONS] +Usage: test [OPTIONS] Options: -p [] diff --git a/tests/ui/arg_required_else_help_stderr.toml b/tests/ui/arg_required_else_help_stderr.toml index 94bcce849f6..8792afae84a 100644 --- a/tests/ui/arg_required_else_help_stderr.toml +++ b/tests/ui/arg_required_else_help_stderr.toml @@ -3,8 +3,7 @@ args = [] status.code = 2 stdout = "" stderr = """ -Usage: - stdio-fixture[EXE] [OPTIONS] [COMMAND] +Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND] Commands: more diff --git a/tests/ui/error_stderr.toml b/tests/ui/error_stderr.toml index 78616b233d0..b8071a476a4 100644 --- a/tests/ui/error_stderr.toml +++ b/tests/ui/error_stderr.toml @@ -7,8 +7,7 @@ error: Found argument '--unknown-argument' which wasn't expected, or isn't valid If you tried to supply `--unknown-argument` as a value rather than a flag, use `-- --unknown-argument` -Usage: - stdio-fixture[EXE] [OPTIONS] [COMMAND] +Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND] For more information try --help """ diff --git a/tests/ui/h_flag_stdout.toml b/tests/ui/h_flag_stdout.toml index b3137a2cec2..24cc1c4c817 100644 --- a/tests/ui/h_flag_stdout.toml +++ b/tests/ui/h_flag_stdout.toml @@ -2,8 +2,7 @@ bin.name = "stdio-fixture" args = ["-h"] status.code = 0 stdout = """ -Usage: - stdio-fixture[EXE] [OPTIONS] [COMMAND] +Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND] Commands: more diff --git a/tests/ui/help_cmd_stdout.toml b/tests/ui/help_cmd_stdout.toml index bbe0dd1cf4f..4ddf84ab8e5 100644 --- a/tests/ui/help_cmd_stdout.toml +++ b/tests/ui/help_cmd_stdout.toml @@ -2,8 +2,7 @@ bin.name = "stdio-fixture" args = ["help"] status.code = 0 stdout = """ -Usage: - stdio-fixture[EXE] [OPTIONS] [COMMAND] +Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND] Commands: more diff --git a/tests/ui/help_flag_stdout.toml b/tests/ui/help_flag_stdout.toml index 1b7cd429b27..99b05f29be7 100644 --- a/tests/ui/help_flag_stdout.toml +++ b/tests/ui/help_flag_stdout.toml @@ -2,8 +2,7 @@ bin.name = "stdio-fixture" args = ["--help"] status.code = 0 stdout = """ -Usage: - stdio-fixture[EXE] [OPTIONS] [COMMAND] +Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND] Commands: more