mirror of
https://github.com/clap-rs/clap
synced 2024-09-20 06:22:06 +00:00
fix(error): Match rustc for giving more information
This commit is contained in:
parent
c2efb60a5f
commit
68a7740fdc
35 changed files with 107 additions and 107 deletions
|
@ -39,7 +39,7 @@ error: found argument '--unknown' which wasn't expected, or isn't valid in this
|
||||||
|
|
||||||
Usage: interop_augment_args[EXE] [OPTIONS]
|
Usage: interop_augment_args[EXE] [OPTIONS]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ error: found argument '--unknown' which wasn't expected, or isn't valid in this
|
||||||
|
|
||||||
Usage: interop_augment_subcommands[EXE] derived [OPTIONS]
|
Usage: interop_augment_subcommands[EXE] derived [OPTIONS]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ error: the subcommand 'unknown' wasn't recognized
|
||||||
|
|
||||||
Usage: interop_augment_subcommands[EXE] [COMMAND]
|
Usage: interop_augment_subcommands[EXE] [COMMAND]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ error: found argument '--unknown' which wasn't expected, or isn't valid in this
|
||||||
|
|
||||||
Usage: interop_hand_subcommand[EXE] add [NAME]...
|
Usage: interop_hand_subcommand[EXE] add [NAME]...
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ error: the subcommand 'unknown' wasn't recognized
|
||||||
|
|
||||||
Usage: interop_hand_subcommand[EXE] [OPTIONS] <COMMAND>
|
Usage: interop_hand_subcommand[EXE] [OPTIONS] <COMMAND>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -243,6 +243,6 @@ error: found argument '--unknown' which wasn't expected, or isn't valid in this
|
||||||
|
|
||||||
Usage: interop_flatten_hand_args[EXE] [OPTIONS]
|
Usage: interop_flatten_hand_args[EXE] [OPTIONS]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -37,7 +37,7 @@ error: found argument 'foo' which wasn't expected, or isn't valid in this contex
|
||||||
|
|
||||||
Usage: escaped-positional-derive[EXE] [OPTIONS] [-- <SLOP>...]
|
Usage: escaped-positional-derive[EXE] [OPTIONS] [-- <SLOP>...]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ error: found argument 'foo' which wasn't expected, or isn't valid in this contex
|
||||||
|
|
||||||
Usage: escaped-positional[EXE] [OPTIONS] [-- <SLOP>...]
|
Usage: escaped-positional[EXE] [OPTIONS] [-- <SLOP>...]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ 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'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,6 @@ error: the argument '--verbose' was provided more than once, but cannot be used
|
||||||
|
|
||||||
Usage: 03_01_flag_bool[EXE] [OPTIONS]
|
Usage: 03_01_flag_bool[EXE] [OPTIONS]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -42,6 +42,6 @@ $ 04_01_enum medium
|
||||||
error: 'medium' isn't a valid value for '<MODE>'
|
error: 'medium' isn't a valid value for '<MODE>'
|
||||||
[possible values: fast, slow]
|
[possible values: fast, slow]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -22,6 +22,6 @@ $ 04_01_possible medium
|
||||||
error: 'medium' isn't a valid value for '<MODE>'
|
error: 'medium' isn't a valid value for '<MODE>'
|
||||||
[possible values: fast, slow]
|
[possible values: fast, slow]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -18,12 +18,12 @@ $ 04_02_parse foobar
|
||||||
? failed
|
? failed
|
||||||
error: invalid value 'foobar' for '<PORT>': invalid digit found in string
|
error: invalid value 'foobar' for '<PORT>': invalid digit found in string
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_02_parse_derive 0
|
$ 04_02_parse_derive 0
|
||||||
? failed
|
? failed
|
||||||
error: invalid value '0' for '<PORT>': 0 is not in 1..=65535
|
error: invalid value '0' for '<PORT>': 0 is not in 1..=65535
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -18,12 +18,12 @@ $ 04_02_validate foobar
|
||||||
? failed
|
? failed
|
||||||
error: invalid value 'foobar' for '<PORT>': `foobar` isn't a port number
|
error: invalid value 'foobar' for '<PORT>': `foobar` isn't a port number
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_02_validate 0
|
$ 04_02_validate 0
|
||||||
? failed
|
? failed
|
||||||
error: invalid value '0' for '<PORT>': port not in range 1-65535
|
error: invalid value '0' for '<PORT>': port not in range 1-65535
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -24,7 +24,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: 04_03_relations[EXE] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
|
Usage: 04_03_relations[EXE] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_03_relations --major
|
$ 04_03_relations --major
|
||||||
Version: 2.2.3
|
Version: 2.2.3
|
||||||
|
@ -35,7 +35,7 @@ error: the argument '--major' cannot be used with '--minor'
|
||||||
|
|
||||||
Usage: 04_03_relations[EXE] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
|
Usage: 04_03_relations[EXE] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_03_relations --major -c config.toml
|
$ 04_03_relations --major -c config.toml
|
||||||
? failed
|
? failed
|
||||||
|
@ -44,7 +44,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: 04_03_relations[EXE] -c <CONFIG> <--set-ver <VER>|--major|--minor|--patch> <INPUT_FILE|--spec-in <SPEC_IN>>
|
Usage: 04_03_relations[EXE] -c <CONFIG> <--set-ver <VER>|--major|--minor|--patch> <INPUT_FILE|--spec-in <SPEC_IN>>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_03_relations --major -c config.toml --spec-in input.txt
|
$ 04_03_relations --major -c config.toml --spec-in input.txt
|
||||||
Version: 2.2.3
|
Version: 2.2.3
|
||||||
|
|
|
@ -23,7 +23,7 @@ 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'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_04_custom --major
|
$ 04_04_custom --major
|
||||||
Version: 2.2.3
|
Version: 2.2.3
|
||||||
|
@ -34,7 +34,7 @@ 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'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_04_custom --major -c config.toml
|
$ 04_04_custom --major -c config.toml
|
||||||
? failed
|
? failed
|
||||||
|
@ -43,7 +43,7 @@ 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'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_04_custom --major -c config.toml --spec-in input.txt
|
$ 04_04_custom --major -c config.toml --spec-in input.txt
|
||||||
Version: 2.2.3
|
Version: 2.2.3
|
||||||
|
|
|
@ -21,6 +21,6 @@ error: the argument '--verbose' was provided more than once, but cannot be used
|
||||||
|
|
||||||
Usage: 03_01_flag_bool_derive[EXE] [OPTIONS]
|
Usage: 03_01_flag_bool_derive[EXE] [OPTIONS]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -42,6 +42,6 @@ $ 04_01_enum_derive medium
|
||||||
error: 'medium' isn't a valid value for '<MODE>'
|
error: 'medium' isn't a valid value for '<MODE>'
|
||||||
[possible values: fast, slow]
|
[possible values: fast, slow]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -18,12 +18,12 @@ $ 04_02_parse_derive foobar
|
||||||
? failed
|
? failed
|
||||||
error: invalid value 'foobar' for '<PORT>': invalid digit found in string
|
error: invalid value 'foobar' for '<PORT>': invalid digit found in string
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_02_parse_derive 0
|
$ 04_02_parse_derive 0
|
||||||
? failed
|
? failed
|
||||||
error: invalid value '0' for '<PORT>': 0 is not in 1..=65535
|
error: invalid value '0' for '<PORT>': 0 is not in 1..=65535
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -18,12 +18,12 @@ $ 04_02_validate_derive foobar
|
||||||
? failed
|
? failed
|
||||||
error: invalid value 'foobar' for '<PORT>': `foobar` isn't a port number
|
error: invalid value 'foobar' for '<PORT>': `foobar` isn't a port number
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_02_validate_derive 0
|
$ 04_02_validate_derive 0
|
||||||
? failed
|
? failed
|
||||||
error: invalid value '0' for '<PORT>': port not in range 1-65535
|
error: invalid value '0' for '<PORT>': port not in range 1-65535
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -24,7 +24,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: 04_03_relations_derive[EXE] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
|
Usage: 04_03_relations_derive[EXE] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_03_relations_derive --major
|
$ 04_03_relations_derive --major
|
||||||
Version: 2.2.3
|
Version: 2.2.3
|
||||||
|
@ -35,7 +35,7 @@ error: the argument '--major' cannot be used with '--minor'
|
||||||
|
|
||||||
Usage: 04_03_relations_derive[EXE] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
|
Usage: 04_03_relations_derive[EXE] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_03_relations_derive --major -c config.toml
|
$ 04_03_relations_derive --major -c config.toml
|
||||||
? failed
|
? failed
|
||||||
|
@ -44,7 +44,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: 04_03_relations_derive[EXE] -c <CONFIG> <--set-ver <VER>|--major|--minor|--patch> <INPUT_FILE|--spec-in <SPEC_IN>>
|
Usage: 04_03_relations_derive[EXE] -c <CONFIG> <--set-ver <VER>|--major|--minor|--patch> <INPUT_FILE|--spec-in <SPEC_IN>>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_03_relations_derive --major -c config.toml --spec-in input.txt
|
$ 04_03_relations_derive --major -c config.toml --spec-in input.txt
|
||||||
Version: 2.2.3
|
Version: 2.2.3
|
||||||
|
|
|
@ -23,7 +23,7 @@ error: Can only modify one version field
|
||||||
|
|
||||||
Usage: clap [OPTIONS] [INPUT_FILE]
|
Usage: clap [OPTIONS] [INPUT_FILE]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_04_custom_derive --major
|
$ 04_04_custom_derive --major
|
||||||
Version: 2.2.3
|
Version: 2.2.3
|
||||||
|
@ -34,7 +34,7 @@ error: Can only modify one version field
|
||||||
|
|
||||||
Usage: clap [OPTIONS] [INPUT_FILE]
|
Usage: clap [OPTIONS] [INPUT_FILE]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_04_custom_derive --major -c config.toml
|
$ 04_04_custom_derive --major -c config.toml
|
||||||
? failed
|
? failed
|
||||||
|
@ -43,7 +43,7 @@ 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'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ 04_04_custom_derive --major -c config.toml --spec-in input.txt
|
$ 04_04_custom_derive --major -c config.toml --spec-in input.txt
|
||||||
Version: 2.2.3
|
Version: 2.2.3
|
||||||
|
|
|
@ -26,7 +26,7 @@ $ typed-derive -O plaid
|
||||||
? failed
|
? failed
|
||||||
error: invalid value 'plaid' for '-O <OPTIMIZATION>': invalid digit found in string
|
error: invalid value 'plaid' for '-O <OPTIMIZATION>': invalid digit found in string
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ $ typed-derive --bind localhost
|
||||||
? failed
|
? failed
|
||||||
error: invalid value 'localhost' for '--bind <BIND>': invalid IP address syntax
|
error: invalid value 'localhost' for '--bind <BIND>': invalid IP address syntax
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ $ typed-derive --sleep forever
|
||||||
? failed
|
? failed
|
||||||
error: invalid value 'forever' for '--sleep <SLEEP>': expected number at 0
|
error: invalid value 'forever' for '--sleep <SLEEP>': expected number at 0
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -72,13 +72,13 @@ $ typed-derive -D Foo
|
||||||
? failed
|
? failed
|
||||||
error: invalid value 'Foo' for '-D <DEFINES>': invalid KEY=value: no `=` found in `Foo`
|
error: invalid value 'Foo' for '-D <DEFINES>': invalid KEY=value: no `=` found in `Foo`
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ typed-derive -D Foo=Bar
|
$ typed-derive -D Foo=Bar
|
||||||
? failed
|
? failed
|
||||||
error: invalid value 'Foo=Bar' for '-D <DEFINES>': invalid digit found in string
|
error: invalid value 'Foo=Bar' for '-D <DEFINES>': invalid digit found in string
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -95,14 +95,14 @@ $ typed-derive --port
|
||||||
error: the argument '--port <PORT>' requires a value but none was supplied
|
error: the argument '--port <PORT>' requires a value but none was supplied
|
||||||
[possible values: 22, 80]
|
[possible values: 22, 80]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ typed-derive --port 3000
|
$ typed-derive --port 3000
|
||||||
? failed
|
? failed
|
||||||
error: '3000' isn't a valid value for '--port <PORT>'
|
error: '3000' isn't a valid value for '--port <PORT>'
|
||||||
[possible values: 22, 80]
|
[possible values: 22, 80]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -119,13 +119,13 @@ $ typed-derive --log-level
|
||||||
error: the argument '--log-level <LOG_LEVEL>' requires a value but none was supplied
|
error: the argument '--log-level <LOG_LEVEL>' requires a value but none was supplied
|
||||||
[possible values: info, debug, info, warn, error]
|
[possible values: info, debug, info, warn, error]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
$ typed-derive --log-level critical
|
$ typed-derive --log-level critical
|
||||||
? failed
|
? failed
|
||||||
error: 'critical' isn't a valid value for '--log-level <LOG_LEVEL>'
|
error: 'critical' isn't a valid value for '--log-level <LOG_LEVEL>'
|
||||||
[possible values: info, debug, info, warn, error]
|
[possible values: info, debug, info, warn, error]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -417,9 +417,9 @@ pub(crate) fn get_help_flag(cmd: &Command) -> Option<&'static str> {
|
||||||
|
|
||||||
fn try_help(styled: &mut StyledStr, help: Option<&str>) {
|
fn try_help(styled: &mut StyledStr, help: Option<&str>) {
|
||||||
if let Some(help) = help {
|
if let Some(help) = help {
|
||||||
styled.none("\n\nFor more information try '");
|
styled.none("\n\nFor more information, try '");
|
||||||
styled.literal(help.to_owned());
|
styled.literal(help.to_owned());
|
||||||
styled.none("'\n");
|
styled.none("'.\n");
|
||||||
} else {
|
} else {
|
||||||
styled.none("\n");
|
styled.none("\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ error: 'sc_required' requires a subcommand but one was not provided
|
||||||
|
|
||||||
Usage: sc_required <COMMAND>
|
Usage: sc_required <COMMAND>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("sc_required")
|
let cmd = Command::new("sc_required")
|
||||||
|
|
|
@ -325,7 +325,7 @@ error: the argument '--flag...' cannot be used with '-F'
|
||||||
|
|
||||||
Usage: clap-test --flag... --long-option-2 <option2> <positional> <positional2> [positional3]...
|
Usage: clap-test --flag... --long-option-2 <option2> <positional> <positional2> [positional3]...
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(
|
utils::assert_output(
|
||||||
|
@ -344,7 +344,7 @@ error: the argument '-F' cannot be used with '--flag...'
|
||||||
|
|
||||||
Usage: clap-test -F --long-option-2 <option2> <positional> <positional2> [positional3]...
|
Usage: clap-test -F --long-option-2 <option2> <positional> <positional2> [positional3]...
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(
|
utils::assert_output(
|
||||||
|
@ -363,7 +363,7 @@ error: the argument '-F' was provided more than once, but cannot be used multipl
|
||||||
|
|
||||||
Usage: clap-test [OPTIONS] [positional] [positional2] [positional3]... [COMMAND]
|
Usage: clap-test [OPTIONS] [positional] [positional2] [positional3]... [COMMAND]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(utils::complex_app(), "clap-test -F -F", ERR, true);
|
utils::assert_output(utils::complex_app(), "clap-test -F -F", ERR, true);
|
||||||
|
@ -377,7 +377,7 @@ error: the argument '--flag...' cannot be used with '-F'
|
||||||
|
|
||||||
Usage: clap-test --flag... --long-option-2 <option2> <positional> <positional2> [positional3]...
|
Usage: clap-test --flag... --long-option-2 <option2> <positional> <positional2> [positional3]...
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(
|
utils::assert_output(
|
||||||
|
@ -396,7 +396,7 @@ error: the argument '-F' cannot be used with '--flag...'
|
||||||
|
|
||||||
Usage: clap-test -F --long-option-2 <option2> <positional> <positional2> [positional3]...
|
Usage: clap-test -F --long-option-2 <option2> <positional> <positional2> [positional3]...
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(
|
utils::assert_output(
|
||||||
|
@ -417,7 +417,7 @@ error: the argument '--one' cannot be used with:
|
||||||
|
|
||||||
Usage: three_conflicting_arguments --one
|
Usage: three_conflicting_arguments --one
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("three_conflicting_arguments")
|
let cmd = Command::new("three_conflicting_arguments")
|
||||||
|
@ -739,7 +739,7 @@ error: found argument 'sub1' which wasn't expected, or isn't valid in this conte
|
||||||
Usage: test [OPTIONS]
|
Usage: test [OPTIONS]
|
||||||
test <COMMAND>
|
test <COMMAND>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("test")
|
let cmd = Command::new("test")
|
||||||
|
|
|
@ -735,7 +735,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: bug <input>
|
Usage: bug <input>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
",
|
",
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
|
@ -64,7 +64,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: prog -b -c
|
Usage: prog -b -c
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let res = cmd().try_get_matches_from(vec!["", "-b"]);
|
let res = cmd().try_get_matches_from(vec!["", "-b"]);
|
||||||
|
@ -79,7 +79,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: prog -c -b
|
Usage: prog -c -b
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let res = cmd().try_get_matches_from(vec!["", "-c"]);
|
let res = cmd().try_get_matches_from(vec!["", "-c"]);
|
||||||
|
|
|
@ -122,7 +122,7 @@ fn no_empty_values_without_equals_but_requires_equals() {
|
||||||
|
|
||||||
Usage: config [OPTIONS]
|
Usage: config [OPTIONS]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(cmd, "config --config", NO_EUQALS_ERROR, true);
|
utils::assert_output(cmd, "config --config", NO_EUQALS_ERROR, true);
|
||||||
|
|
|
@ -27,7 +27,7 @@ fn app_error() {
|
||||||
|
|
||||||
Usage: test [OPTIONS] --all
|
Usage: test [OPTIONS] --all
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
let cmd = Command::new("test")
|
let cmd = Command::new("test")
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -124,7 +124,7 @@ error: found argument 'unused' which wasn't expected, or isn't valid in this con
|
||||||
|
|
||||||
Usage: test
|
Usage: test
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
assert_error(err, expected_kind, MESSAGE, true);
|
assert_error(err, expected_kind, MESSAGE, true);
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ error: found argument '--foo' which wasn't expected, or isn't valid in this cont
|
||||||
|
|
||||||
Usage: rg [PATTERN]
|
Usage: rg [PATTERN]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
assert_error(err, expected_kind, MESSAGE, true);
|
assert_error(err, expected_kind, MESSAGE, true);
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ error: found argument '--foo' which wasn't expected, or isn't valid in this cont
|
||||||
|
|
||||||
Usage: rg [PATTERN]
|
Usage: rg [PATTERN]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
assert_error(err, expected_kind, MESSAGE, true);
|
assert_error(err, expected_kind, MESSAGE, true);
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ error: found argument '--foo' which wasn't expected, or isn't valid in this cont
|
||||||
|
|
||||||
Usage: test
|
Usage: test
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
assert_error(err, expected_kind, MESSAGE, true);
|
assert_error(err, expected_kind, MESSAGE, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ error: the value 'foo' was provided to '--a-flag' but it wasn't expecting any mo
|
||||||
|
|
||||||
Usage: mycat --a-flag [filename]
|
Usage: mycat --a-flag [filename]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("mycat")
|
let cmd = Command::new("mycat")
|
||||||
|
@ -164,7 +164,7 @@ error: found argument '--another-flag' which wasn't expected, or isn't valid in
|
||||||
|
|
||||||
Usage: mycat [OPTIONS] [filename]
|
Usage: mycat [OPTIONS] [filename]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("mycat")
|
let cmd = Command::new("mycat")
|
||||||
|
@ -208,7 +208,7 @@ error: found argument '-----' which wasn't expected, or isn't valid in this cont
|
||||||
|
|
||||||
Usage: test <arg>
|
Usage: test <arg>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
let cmd = Command::new("test").arg(Arg::new("arg").action(ArgAction::Set).required(true));
|
let cmd = Command::new("test").arg(Arg::new("arg").action(ArgAction::Set).required(true));
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ fn req_group_usage_string() {
|
||||||
|
|
||||||
Usage: clap-test <base|--delete>
|
Usage: clap-test <base|--delete>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("req_group")
|
let cmd = Command::new("req_group")
|
||||||
|
@ -161,7 +161,7 @@ error: the argument '--delete' cannot be used with '[base]'
|
||||||
|
|
||||||
Usage: clap-test <base|--delete>
|
Usage: clap-test <base|--delete>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("req_group")
|
let cmd = Command::new("req_group")
|
||||||
|
@ -191,7 +191,7 @@ error: the argument '--delete' cannot be used with '--all'
|
||||||
|
|
||||||
Usage: clap-test <--all|--delete>
|
Usage: clap-test <--all|--delete>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("req_group")
|
let cmd = Command::new("req_group")
|
||||||
|
@ -309,7 +309,7 @@ error: the argument '--major' cannot be used with '--minor'
|
||||||
|
|
||||||
Usage: prog --major
|
Usage: prog --major
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("prog")
|
let cmd = Command::new("prog")
|
||||||
|
@ -329,7 +329,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: prog --config <--in|--spec>
|
Usage: prog --config <--in|--spec>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("prog")
|
let cmd = Command::new("prog")
|
||||||
|
|
|
@ -83,7 +83,7 @@ fn help_multi_subcommand_error() {
|
||||||
|
|
||||||
Usage: ctest subcmd multi [OPTIONS]
|
Usage: ctest subcmd multi [OPTIONS]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
utils::assert_eq(EXPECTED, err.to_string());
|
utils::assert_eq(EXPECTED, err.to_string());
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ fn require_equals_fail_message() {
|
||||||
|
|
||||||
Usage: prog [OPTIONS]
|
Usage: prog [OPTIONS]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
let cmd = Command::new("prog").arg(
|
let cmd = Command::new("prog").arg(
|
||||||
Arg::new("cfg")
|
Arg::new("cfg")
|
||||||
|
@ -452,7 +452,7 @@ error: found argument '--optio' which wasn't expected, or isn't valid in this co
|
||||||
|
|
||||||
Usage: clap-test --option <opt>... [positional] [positional2] [positional3]...
|
Usage: clap-test --option <opt>... [positional] [positional2] [positional3]...
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(utils::complex_app(), "clap-test --optio=foo", DYM, true);
|
utils::assert_output(utils::complex_app(), "clap-test --optio=foo", DYM, true);
|
||||||
|
@ -550,7 +550,7 @@ error: found argument '--files-without-matches' which wasn't expected, or isn't
|
||||||
|
|
||||||
Usage: ripgrep-616 --files-without-match
|
Usage: ripgrep-616 --files-without-match
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("ripgrep-616")
|
let cmd = Command::new("ripgrep-616")
|
||||||
|
|
|
@ -183,7 +183,7 @@ error: 'slo' isn't a valid value for '-O <option>'
|
||||||
|
|
||||||
note: value 'slow' exists
|
note: value 'slow' exists
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
#[cfg(not(feature = "suggestions"))]
|
#[cfg(not(feature = "suggestions"))]
|
||||||
|
@ -191,7 +191,7 @@ For more information try '--help'
|
||||||
error: 'slo' isn't a valid value for '-O <option>'
|
error: 'slo' isn't a valid value for '-O <option>'
|
||||||
[possible values: slow, fast, \"ludicrous speed\"]
|
[possible values: slow, fast, \"ludicrous speed\"]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(
|
utils::assert_output(
|
||||||
|
@ -217,7 +217,7 @@ error: 'slo' isn't a valid value for '-O <option>'
|
||||||
|
|
||||||
note: value 'slow' exists
|
note: value 'slow' exists
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
#[cfg(not(feature = "suggestions"))]
|
#[cfg(not(feature = "suggestions"))]
|
||||||
|
@ -225,7 +225,7 @@ For more information try '--help'
|
||||||
error: 'slo' isn't a valid value for '-O <option>'
|
error: 'slo' isn't a valid value for '-O <option>'
|
||||||
[possible values: slow, fast, \"ludicrous speed\"]
|
[possible values: slow, fast, \"ludicrous speed\"]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(
|
utils::assert_output(
|
||||||
|
@ -255,7 +255,7 @@ error: 'slo' isn't a valid value for '-O <option>'
|
||||||
|
|
||||||
note: value 'slow' exists
|
note: value 'slow' exists
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
#[cfg(not(feature = "suggestions"))]
|
#[cfg(not(feature = "suggestions"))]
|
||||||
|
@ -263,7 +263,7 @@ For more information try '--help'
|
||||||
error: 'slo' isn't a valid value for '-O <option>'
|
error: 'slo' isn't a valid value for '-O <option>'
|
||||||
[possible values: slow, fast, \"ludicrous speed\"]
|
[possible values: slow, fast, \"ludicrous speed\"]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(
|
utils::assert_output(
|
||||||
|
@ -294,7 +294,7 @@ error: 'ludicrous' isn't a valid value for '-O <option>'
|
||||||
|
|
||||||
note: value 'ludicrous speed' exists
|
note: value 'ludicrous speed' exists
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
#[cfg(not(feature = "suggestions"))]
|
#[cfg(not(feature = "suggestions"))]
|
||||||
|
@ -302,7 +302,7 @@ For more information try '--help'
|
||||||
error: 'ludicrous' isn't a valid value for '-O <option>'
|
error: 'ludicrous' isn't a valid value for '-O <option>'
|
||||||
[possible values: slow, fast, \"ludicrous speed\"]
|
[possible values: slow, fast, \"ludicrous speed\"]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(
|
utils::assert_output(
|
||||||
|
@ -325,7 +325,7 @@ fn missing_possible_value_error() {
|
||||||
error: the argument '-O <option>' requires a value but none was supplied
|
error: the argument '-O <option>' requires a value but none was supplied
|
||||||
[possible values: slow, fast, \"ludicrous speed\"]
|
[possible values: slow, fast, \"ludicrous speed\"]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(
|
utils::assert_output(
|
||||||
|
|
|
@ -90,7 +90,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: clap-test <flag> <opt> [bar]
|
Usage: clap-test <flag> <opt> [bar]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("positional_required")
|
let cmd = Command::new("positional_required")
|
||||||
|
@ -110,7 +110,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: clap-test <flag> [opt] [bar]
|
Usage: clap-test <flag> [opt] [bar]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("positional_required")
|
let cmd = Command::new("positional_required")
|
||||||
|
@ -131,7 +131,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: clap-test <flag> <foo> <opt> [bar]
|
Usage: clap-test <flag> <foo> <opt> [bar]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("positional_required")
|
let cmd = Command::new("positional_required")
|
||||||
|
@ -520,7 +520,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: clap-test --long-option-2 <option2> -F <positional> <positional2> [positional3]...
|
Usage: clap-test --long-option-2 <option2> -F <positional> <positional2> [positional3]...
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
utils::assert_output(utils::complex_app(), "clap-test -F", MISSING_REQ, true);
|
utils::assert_output(utils::complex_app(), "clap-test -F", MISSING_REQ, true);
|
||||||
|
@ -763,7 +763,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: test --target <target> --input <input> --output <output>
|
Usage: test --target <target> --input <input> --output <output>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("Test cmd")
|
let cmd = Command::new("Test cmd")
|
||||||
|
@ -807,7 +807,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: test --target <target> --input <input> --output <output>
|
Usage: test --target <target> --input <input> --output <output>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("Test cmd")
|
let cmd = Command::new("Test cmd")
|
||||||
|
@ -932,7 +932,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: clap-test --opt=<FILE>
|
Usage: clap-test --opt=<FILE>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("clap-test").version("v1.4.8").arg(
|
let cmd = Command::new("clap-test").version("v1.4.8").arg(
|
||||||
|
@ -956,7 +956,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: clap-test --opt=<FILE> --foo=<FILE>
|
Usage: clap-test --opt=<FILE> --foo=<FILE>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("clap-test")
|
let cmd = Command::new("clap-test")
|
||||||
|
@ -991,7 +991,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: clap-test --opt=<FILE> --foo=<FILE> <--g1=<FILE>|--g2=<FILE>>
|
Usage: clap-test --opt=<FILE> --foo=<FILE> <--g1=<FILE>|--g2=<FILE>>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("clap-test")
|
let cmd = Command::new("clap-test")
|
||||||
|
@ -1071,7 +1071,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: test --c <c> --a <a> --b <b>
|
Usage: test --c <c> --a <a> --b <b>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
let cmd = Command::new("test")
|
let cmd = Command::new("test")
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -1116,7 +1116,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: example -x <X> -y <Y> -z <Z> <ID>
|
Usage: example -x <X> -y <Y> -z <Z> <ID>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = issue_1158_app();
|
let cmd = issue_1158_app();
|
||||||
|
@ -1451,7 +1451,7 @@ error: the argument '-b <b>' cannot be used with '-c <c>'
|
||||||
|
|
||||||
Usage: clap-test -b <b> <a>
|
Usage: clap-test -b <b> <a>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
utils::assert_output(cmd, "clap-test aaa -b bbb -c ccc", EXPECTED, true);
|
utils::assert_output(cmd, "clap-test aaa -b bbb -c ccc", EXPECTED, true);
|
||||||
}
|
}
|
||||||
|
@ -1474,7 +1474,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: test --require-first <--first|--second>
|
Usage: test --require-first <--first|--second>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
utils::assert_output(cmd, "test --require-first --second", EXPECTED, true);
|
utils::assert_output(cmd, "test --require-first --second", EXPECTED, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ error: the subcommand 'subcm' wasn't recognized
|
||||||
|
|
||||||
Usage: dym [COMMAND]
|
Usage: dym [COMMAND]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("dym").subcommand(Command::new("subcmd"));
|
let cmd = Command::new("dym").subcommand(Command::new("subcmd"));
|
||||||
|
@ -125,7 +125,7 @@ error: the subcommand 'te' wasn't recognized
|
||||||
|
|
||||||
Usage: dym [COMMAND]
|
Usage: dym [COMMAND]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("dym")
|
let cmd = Command::new("dym")
|
||||||
|
@ -145,7 +145,7 @@ error: found argument '--subcmarg' which wasn't expected, or isn't valid in this
|
||||||
|
|
||||||
Usage: dym [COMMAND]
|
Usage: dym [COMMAND]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("dym")
|
let cmd = Command::new("dym")
|
||||||
|
@ -163,7 +163,7 @@ error: found argument '--subcmarg' which wasn't expected, or isn't valid in this
|
||||||
|
|
||||||
Usage: dym [COMMAND]
|
Usage: dym [COMMAND]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("dym")
|
let cmd = Command::new("dym")
|
||||||
|
@ -357,7 +357,7 @@ error: found argument 'subcmd' which wasn't expected, or isn't valid in this con
|
||||||
|
|
||||||
Usage: cmd [COMMAND]
|
Usage: cmd [COMMAND]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
|
|
||||||
let cmd = Command::new("cmd").subcommand(Command::new("subcmd"));
|
let cmd = Command::new("cmd").subcommand(Command::new("subcmd"));
|
||||||
|
@ -432,7 +432,7 @@ fn subcommand_not_recognized() {
|
||||||
|
|
||||||
Usage: fake [COMMAND]
|
Usage: fake [COMMAND]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
",
|
",
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
@ -506,7 +506,7 @@ error: the subcommand 'world' wasn't recognized
|
||||||
|
|
||||||
Usage: <COMMAND>
|
Usage: <COMMAND>
|
||||||
|
|
||||||
For more information try 'help'
|
For more information, try 'help'.
|
||||||
";
|
";
|
||||||
utils::assert_eq(HELLO_EXPECTED, err.to_string());
|
utils::assert_eq(HELLO_EXPECTED, err.to_string());
|
||||||
|
|
||||||
|
@ -522,7 +522,7 @@ error: the subcommand 'baz' wasn't recognized
|
||||||
|
|
||||||
Usage: <COMMAND>
|
Usage: <COMMAND>
|
||||||
|
|
||||||
For more information try 'help'
|
For more information, try 'help'.
|
||||||
";
|
";
|
||||||
utils::assert_eq(BAZ_EXPECTED, err.to_string());
|
utils::assert_eq(BAZ_EXPECTED, err.to_string());
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ error: the following required arguments were not provided:
|
||||||
|
|
||||||
Usage: prog --add <CRATES|--path <PATH>|--git <GIT>>
|
Usage: prog --add <CRATES|--path <PATH>|--git <GIT>>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
";
|
";
|
||||||
assert_output::<Opt>("prog --add", OUTPUT, true);
|
assert_output::<Opt>("prog --add", OUTPUT, true);
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@ fn derive_generated_error_has_full_context() {
|
||||||
Usage: clap --req-str <REQ_STR>
|
Usage: clap --req-str <REQ_STR>
|
||||||
clap <COMMAND>
|
clap <COMMAND>
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
"#;
|
"#;
|
||||||
assert_eq!(result.unwrap_err().to_string(), expected);
|
assert_eq!(result.unwrap_err().to_string(), expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,5 @@ error: found argument '--unknown-argument' which wasn't expected, or isn't valid
|
||||||
|
|
||||||
Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND]
|
Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND]
|
||||||
|
|
||||||
For more information try '--help'
|
For more information, try '--help'.
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue