Skip to content

Commit

Permalink
Merge pull request #4188 from epage/usage
Browse files Browse the repository at this point in the history
fix(help): Collapse usage to one line
  • Loading branch information
epage committed Sep 7, 2022
2 parents f97670a + 9a645d2 commit a228df3
Show file tree
Hide file tree
Showing 86 changed files with 343 additions and 647 deletions.
6 changes: 2 additions & 4 deletions examples/cargo-example-derive.md
Expand Up @@ -6,8 +6,7 @@ mimicking cargo's interface.
The help looks like:
```console
$ cargo-example-derive --help
Usage:
cargo <COMMAND>
Usage: cargo <COMMAND>

Commands:
example-derive A simple to use, efficient, and full-featured Command Line Argument Parser
Expand All @@ -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 <MANIFEST_PATH>
Expand Down
6 changes: 2 additions & 4 deletions examples/cargo-example.md
Expand Up @@ -6,8 +6,7 @@ mimicking cargo's interface.
The help looks like:
```console
$ cargo-example --help
Usage:
cargo <COMMAND>
Usage: cargo <COMMAND>

Commands:
example A simple to use, efficient, and full-featured Command Line Argument Parser
Expand All @@ -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 <PATH>
Expand Down
3 changes: 1 addition & 2 deletions examples/demo.md
Expand Up @@ -2,8 +2,7 @@
$ demo --help
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
demo[EXE] [OPTIONS] --name <NAME>
Usage: demo[EXE] [OPTIONS] --name <NAME>

Options:
-n, --name <NAME> Name of the person to greet
Expand Down
6 changes: 2 additions & 4 deletions examples/derive_ref/custom-bool.md
Expand Up @@ -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 <FOO> <BOOM>
Usage: custom-bool[EXE] [OPTIONS] --foo <FOO> <BOOM>

Arguments:
<BOOM> [possible values: true, false]
Expand All @@ -24,8 +23,7 @@ error: The following required arguments were not provided:
--foo <FOO>
<BOOM>

Usage:
custom-bool[EXE] --foo <FOO> <BOOM>
Usage: custom-bool[EXE] --foo <FOO> <BOOM>

For more information try --help

Expand Down
21 changes: 7 additions & 14 deletions examples/derive_ref/interop_tests.md
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -101,8 +98,7 @@ For more information try --help
```console
$ interop_hand_subcommand
? failed
Usage:
interop_hand_subcommand[EXE] [OPTIONS] <COMMAND>
Usage: interop_hand_subcommand[EXE] [OPTIONS] <COMMAND>

Commands:
add
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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] <COMMAND>
Usage: interop_hand_subcommand[EXE] [OPTIONS] <COMMAND>

For more information try --help

Expand Down Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions examples/escaped-positional-derive.md
Expand Up @@ -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] [-- <SLOP>...]
Usage: escaped-positional-derive[EXE] [OPTIONS] [-- <SLOP>...]

Arguments:
[SLOP]...
Expand Down Expand Up @@ -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] [-- <SLOP>...]
Usage: escaped-positional-derive[EXE] [OPTIONS] [-- <SLOP>...]

For more information try --help

Expand Down
6 changes: 2 additions & 4 deletions examples/escaped-positional.md
Expand Up @@ -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] [-- <SLOP>...]
Usage: escaped-positional[EXE] [OPTIONS] [-- <SLOP>...]

Arguments:
[SLOP]...
Expand Down Expand Up @@ -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] [-- <SLOP>...]
Usage: escaped-positional[EXE] [OPTIONS] [-- <SLOP>...]

For more information try --help

Expand Down
3 changes: 1 addition & 2 deletions examples/find.md
Expand Up @@ -4,8 +4,7 @@
$ find --help
A simple to use, efficient, and full-featured Command Line Argument Parser

Usage:
find[EXE] [OPTIONS] --name <NAME>
Usage: find[EXE] [OPTIONS] --name <NAME>

Options:
-h, --help Print help information
Expand Down
23 changes: 8 additions & 15 deletions examples/git-derive.md
Expand Up @@ -8,8 +8,7 @@ $ git-derive
? failed
A fictional versioning CLI

Usage:
git-derive[EXE] <COMMAND>
Usage: git-derive[EXE] <COMMAND>

Commands:
clone Clones repos
Expand All @@ -24,8 +23,7 @@ Options:
$ git-derive help
A fictional versioning CLI

Usage:
git-derive[EXE] <COMMAND>
Usage: git-derive[EXE] <COMMAND>

Commands:
clone Clones repos
Expand All @@ -40,8 +38,7 @@ Options:
$ git-derive help add
adds things

Usage:
git-derive[EXE] add <PATH>...
Usage: git-derive[EXE] add <PATH>...

Arguments:
<PATH>... Stuff to add
Expand All @@ -57,8 +54,7 @@ $ git-derive add
? failed
adds things

Usage:
git-derive[EXE] add <PATH>...
Usage: git-derive[EXE] add <PATH>...

Arguments:
<PATH>... Stuff to add
Expand All @@ -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 <COMMAND>
Usage: git-derive[EXE] stash [OPTIONS]
git-derive[EXE] stash <COMMAND>

Commands:
push
Expand All @@ -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 <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]
Expand Down
23 changes: 8 additions & 15 deletions examples/git.md
Expand Up @@ -6,8 +6,7 @@ $ git
? failed
A fictional versioning CLI

Usage:
git[EXE] <COMMAND>
Usage: git[EXE] <COMMAND>

Commands:
clone Clones repos
Expand All @@ -22,8 +21,7 @@ Options:
$ git help
A fictional versioning CLI

Usage:
git[EXE] <COMMAND>
Usage: git[EXE] <COMMAND>

Commands:
clone Clones repos
Expand All @@ -38,8 +36,7 @@ Options:
$ git help add
adds things

Usage:
git[EXE] add <PATH>...
Usage: git[EXE] add <PATH>...

Arguments:
<PATH>... Stuff to add
Expand All @@ -55,8 +52,7 @@ $ git add
? failed
adds things

Usage:
git[EXE] add <PATH>...
Usage: git[EXE] add <PATH>...

Arguments:
<PATH>... Stuff to add
Expand All @@ -72,9 +68,8 @@ Adding ["Cargo.toml", "Cargo.lock"]
Default subcommand:
```console
$ git stash -h
Usage:
git[EXE] stash [OPTIONS]
git[EXE] stash <COMMAND>
Usage: git[EXE] stash [OPTIONS]
git[EXE] stash <COMMAND>

Commands:
push
Expand All @@ -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 <MESSAGE>
-h, --help Print help information

$ git stash pop -h
Usage:
git[EXE] stash pop [STASH]
Usage: git[EXE] stash pop [STASH]

Arguments:
[STASH]
Expand Down
3 changes: 1 addition & 2 deletions examples/multicall-busybox.md
Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions examples/pacman.md
Expand Up @@ -37,8 +37,7 @@ In the help, this looks like:
$ pacman -h
package manager utility

Usage:
pacman[EXE] <COMMAND>
Usage: pacman[EXE] <COMMAND>

Commands:
query -Q --query Query the package database.
Expand All @@ -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
Expand All @@ -71,8 +69,7 @@ $ pacman -S -s foo -i bar
? failed
error: The argument '--search <search>...' cannot be used with '--info'

Usage:
pacman[EXE] {sync|--sync|-S} --search <search>... <package>...
Usage: pacman[EXE] {sync|--sync|-S} --search <search>... <package>...

For more information try --help

Expand Down
3 changes: 1 addition & 2 deletions examples/tutorial_builder/01_quick.md
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions examples/tutorial_builder/02_app_settings.md
Expand Up @@ -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 <VALUE> --one <VALUE>
Usage: 02_app_settings[EXE] --two <VALUE> --one <VALUE>

Options:
--two <VALUE>
Expand Down

0 comments on commit a228df3

Please sign in to comment.