Skip to content

Commit

Permalink
Merge pull request #4160 from epage/template
Browse files Browse the repository at this point in the history
fix(help): Remove name/version/author from help
  • Loading branch information
epage committed Aug 31, 2022
2 parents cdb812b + 65b5b5f commit e643e60
Show file tree
Hide file tree
Showing 78 changed files with 172 additions and 330 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
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
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
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
@@ -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
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
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
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
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
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
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
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
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
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
@@ -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
@@ -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
@@ -1,7 +1,5 @@
```console
$ 02_apps --help
MyApp 1.0
Kevin K. <kbknapp@gmail.com>
Does awesome things

Usage:
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial_builder/02_crate.md
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit e643e60

Please sign in to comment.