Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(help): Remove name/version/author from help #4160

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- *(help)* Help headings are now title cased, making any user-provided help headings inconsistent. To get the old behavior, see `Command::help_template`, `Arg::help_heading`, and `Command::subcommand_help_heading`
- *(help)* "Command" is used as the section heading for subcommands and `COMMAND` for the value name. To get the old behavior, see `Command::subcommand_help_heading` and `Arg::subcommand_value_name`
- *(help)* Whitespace in help output is now trimmed to ensure consistency regardless of how well a template matches the users needs.
- *(help)* name/version/author are removed by default from help output. To get the old behavior, see `Command::help_template`.
- *(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)
Expand Down Expand Up @@ -102,6 +103,7 @@ Deprecated
- *(help)* Polish up subcommands by referring to them as commands
- *(help)* Trim extra whitespace to avoid artifacts from different uses of templates
- *(help)* Hint to the user the difference between `-h` / `--help` when applicable (#4159)
- *(help)* Shorten help by eliding name/version/author
- *(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)
Expand Down
3 changes: 0 additions & 3 deletions examples/cargo-example-derive.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ mimicking cargo's interface.
The help looks like:
```console
$ cargo-example-derive --help
cargo

Usage:
cargo <COMMAND>

Expand All @@ -19,7 +17,6 @@ Options:
-h, --help Print help information

$ cargo-example-derive example-derive --help
cargo-example-derive [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
3 changes: 0 additions & 3 deletions examples/cargo-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ mimicking cargo's interface.
The help looks like:
```console
$ cargo-example --help
cargo

Usage:
cargo <COMMAND>

Expand All @@ -19,7 +17,6 @@ Options:
-h, --help Print help information

$ cargo-example example --help
cargo-example [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/demo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ demo --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/derive_ref/custom-bool.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Example of overriding the magic `bool` behavior

```console
$ custom-bool --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
2 changes: 0 additions & 2 deletions examples/derive_ref/interop_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ For more information try --help
```console
$ interop_hand_subcommand
? failed
clap

Usage:
interop_hand_subcommand[EXE] [OPTIONS] <COMMAND>

Expand Down
1 change: 0 additions & 1 deletion examples/escaped-positional-derive.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ You can use `--` to escape further arguments.
Let's see what this looks like in the help:
```console
$ escaped-positional-derive --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/escaped-positional.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ You can use `--` to escape further arguments.
Let's see what this looks like in the help:
```console
$ escaped-positional --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/find.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

```console
$ find --help
clap 4.0.0-alpha.0
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
10 changes: 0 additions & 10 deletions examples/git-derive.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Help:
```console
$ git-derive
? failed
git
A fictional versioning CLI

Usage:
Expand All @@ -23,7 +22,6 @@ Options:
-h, --help Print help information

$ git-derive help
git
A fictional versioning CLI

Usage:
Expand All @@ -40,7 +38,6 @@ Options:
-h, --help Print help information

$ git-derive help add
git-add
adds things

Usage:
Expand All @@ -58,7 +55,6 @@ A basic argument:
```console
$ git-derive add
? failed
git-add
adds things

Usage:
Expand All @@ -78,8 +74,6 @@ Adding ["Cargo.toml", "Cargo.lock"]
Default subcommand:
```console
$ git-derive stash -h
git-stash

Usage:
git-derive[EXE] stash [OPTIONS]
git-derive[EXE] stash <COMMAND>
Expand All @@ -95,8 +89,6 @@ Options:
-h, --help Print help information

$ git-derive stash push -h
git-stash-push

Usage:
git-derive[EXE] stash push [OPTIONS]

Expand All @@ -105,8 +97,6 @@ Options:
-h, --help Print help information

$ git-derive stash pop -h
git-stash-pop

Usage:
git-derive[EXE] stash pop [STASH]

Expand Down
10 changes: 0 additions & 10 deletions examples/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Help:
```console
$ git
? failed
git
A fictional versioning CLI

Usage:
Expand All @@ -21,7 +20,6 @@ Options:
-h, --help Print help information

$ git help
git
A fictional versioning CLI

Usage:
Expand All @@ -38,7 +36,6 @@ Options:
-h, --help Print help information

$ git help add
git-add
adds things

Usage:
Expand All @@ -56,7 +53,6 @@ A basic argument:
```console
$ git add
? failed
git-add
adds things

Usage:
Expand All @@ -76,8 +72,6 @@ Adding ["Cargo.toml", "Cargo.lock"]
Default subcommand:
```console
$ git stash -h
git-stash

Usage:
git[EXE] stash [OPTIONS]
git[EXE] stash <COMMAND>
Expand All @@ -93,8 +87,6 @@ Options:
-h, --help Print help information

$ git stash push -h
git-stash-push

Usage:
git[EXE] stash push [OPTIONS]

Expand All @@ -103,8 +95,6 @@ Options:
-h, --help Print help information

$ git stash pop -h
git-stash-pop

Usage:
git[EXE] stash pop [STASH]

Expand Down
2 changes: 0 additions & 2 deletions examples/multicall-busybox.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ Though users must pass something:
```console
$ busybox
? failed
busybox

Usage:
busybox [OPTIONS] [APPLET]

Expand Down
3 changes: 0 additions & 3 deletions examples/pacman.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ Searching for name...
In the help, this looks like:
```console
$ pacman -h
pacman 5.2.1
Pacman Development Team
package manager utility

Usage:
Expand All @@ -52,7 +50,6 @@ Options:
-V, --version Print version information

$ pacman -S -h
pacman-sync
Synchronize packages.

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/01_quick.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 01_quick --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/02_app_settings.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 02_app_settings --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
2 changes: 0 additions & 2 deletions examples/tutorial_builder/02_apps.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
```console
$ 02_apps --help
MyApp 1.0
Kevin K. <[email protected]>
Does awesome things

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/02_crate.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 02_crate --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/03_01_flag_bool.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 03_01_flag_bool --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/03_01_flag_count.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 03_01_flag_count --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/03_02_option.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 03_02_option --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/03_02_option_mult.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 03_02_option_mult --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/03_03_positional.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 03_03_positional --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/03_03_positional_mult.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 03_03_positional_mult --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
3 changes: 0 additions & 3 deletions examples/tutorial_builder/03_04_subcommands.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 03_04_subcommands help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand All @@ -15,7 +14,6 @@ Options:
-V, --version Print version information

$ 03_04_subcommands help add
clap-add [..]
Adds files to myapp

Usage:
Expand All @@ -37,7 +35,6 @@ Because we set [`Command::arg_required_else_help`][crate::Command::arg_required_
```console
$ 03_04_subcommands
? failed
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/03_05_default_values.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 03_05_default_values --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/04_01_enum.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 04_01_enum --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/04_01_possible.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 04_01_possible --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/04_02_parse.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 04_02_parse --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/04_02_validate.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 04_02_validate --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/04_03_relations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 04_03_relations --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/04_04_custom.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 04_04_custom --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_derive/01_quick.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 01_quick_derive --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_derive/02_app_settings.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```console
$ 02_app_settings_derive --help
clap [..]
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
Expand Down
Loading