diff --git a/examples/derive_ref/custom-bool.md b/examples/derive_ref/custom-bool.md index 9a1d9d74960..04e3ff0ce40 100644 --- a/examples/derive_ref/custom-bool.md +++ b/examples/derive_ref/custom-bool.md @@ -25,7 +25,7 @@ error: The following required arguments were not provided: Usage: custom-bool[EXE] --foo -For more information try --help +For more information try '--help' $ custom-bool --foo true false [examples/derive_ref/custom-bool.rs:31] opt = Opt { diff --git a/examples/derive_ref/interop_tests.md b/examples/derive_ref/interop_tests.md index 87bd7602252..df2b0d259da 100644 --- a/examples/derive_ref/interop_tests.md +++ b/examples/derive_ref/interop_tests.md @@ -41,7 +41,7 @@ error: Found argument '--unknown' which wasn't expected, or isn't valid in this Usage: interop_augment_args[EXE] [OPTIONS] -For more information try --help +For more information try '--help' ``` @@ -78,7 +78,7 @@ error: Found argument '--unknown' which wasn't expected, or isn't valid in this Usage: interop_augment_subcommands[EXE] derived [OPTIONS] -For more information try --help +For more information try '--help' ``` @@ -89,7 +89,7 @@ error: The subcommand 'unknown' wasn't recognized Usage: interop_augment_subcommands[EXE] [COMMAND] -For more information try --help +For more information try '--help' ``` @@ -150,7 +150,7 @@ error: Found argument '--unknown' which wasn't expected, or isn't valid in this Usage: interop_hand_subcommand[EXE] add [NAME]... -For more information try --help +For more information try '--help' ``` @@ -193,7 +193,7 @@ error: The subcommand 'unknown' wasn't recognized Usage: interop_hand_subcommand[EXE] [OPTIONS] -For more information try --help +For more information try '--help' ``` @@ -249,6 +249,6 @@ error: Found argument '--unknown' which wasn't expected, or isn't valid in this Usage: interop_flatten_hand_args[EXE] [OPTIONS] -For more information try --help +For more information try '--help' ``` diff --git a/examples/escaped-positional-derive.md b/examples/escaped-positional-derive.md index 8b957a6c9e4..cd52add6811 100644 --- a/examples/escaped-positional-derive.md +++ b/examples/escaped-positional-derive.md @@ -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] [-- ...] -For more information try --help +For more information try '--help' ``` diff --git a/examples/escaped-positional.md b/examples/escaped-positional.md index 1ebea0628f3..6015cc37e9f 100644 --- a/examples/escaped-positional.md +++ b/examples/escaped-positional.md @@ -37,7 +37,7 @@ error: Found argument 'foo' which wasn't expected, or isn't valid in this contex Usage: escaped-positional[EXE] [OPTIONS] [-- ...] -For more information try --help +For more information try '--help' ``` diff --git a/examples/pacman.md b/examples/pacman.md index 505a3fa3af2..f75ac172d7f 100644 --- a/examples/pacman.md +++ b/examples/pacman.md @@ -71,7 +71,7 @@ error: The argument '--search ...' cannot be used with '--info' Usage: pacman[EXE] {sync|--sync|-S} --search ... ... -For more information try --help +For more information try '--help' ``` diff --git a/examples/tutorial_builder/04_01_enum.md b/examples/tutorial_builder/04_01_enum.md index 405e5db84ce..ef67bc800a9 100644 --- a/examples/tutorial_builder/04_01_enum.md +++ b/examples/tutorial_builder/04_01_enum.md @@ -22,6 +22,6 @@ $ 04_01_enum medium error: "medium" isn't a valid value for '' [possible values: fast, slow] -For more information try --help +For more information try '--help' ``` diff --git a/examples/tutorial_builder/04_01_possible.md b/examples/tutorial_builder/04_01_possible.md index 8ac76889a73..93a4b88679d 100644 --- a/examples/tutorial_builder/04_01_possible.md +++ b/examples/tutorial_builder/04_01_possible.md @@ -22,6 +22,6 @@ $ 04_01_possible medium error: "medium" isn't a valid value for '' [possible values: fast, slow] -For more information try --help +For more information try '--help' ``` diff --git a/examples/tutorial_builder/04_02_parse.md b/examples/tutorial_builder/04_02_parse.md index 6b0b040f164..75e5e18f48e 100644 --- a/examples/tutorial_builder/04_02_parse.md +++ b/examples/tutorial_builder/04_02_parse.md @@ -18,12 +18,12 @@ $ 04_02_parse foobar ? failed error: Invalid value "foobar" for '': invalid digit found in string -For more information try --help +For more information try '--help' $ 04_02_parse_derive 0 ? failed error: Invalid value "0" for '': 0 is not in 1..=65535 -For more information try --help +For more information try '--help' ``` diff --git a/examples/tutorial_builder/04_02_validate.md b/examples/tutorial_builder/04_02_validate.md index f812e918b37..e3ebafa324d 100644 --- a/examples/tutorial_builder/04_02_validate.md +++ b/examples/tutorial_builder/04_02_validate.md @@ -18,12 +18,12 @@ $ 04_02_validate foobar ? failed error: Invalid value "foobar" for '': `foobar` isn't a port number -For more information try --help +For more information try '--help' $ 04_02_validate 0 ? failed error: Invalid value "0" for '': Port not in range 1-65535 -For more information try --help +For more information try '--help' ``` diff --git a/examples/tutorial_builder/04_03_relations.md b/examples/tutorial_builder/04_03_relations.md index 0dda5d3469b..cdca1936a50 100644 --- a/examples/tutorial_builder/04_03_relations.md +++ b/examples/tutorial_builder/04_03_relations.md @@ -24,7 +24,7 @@ error: The following required arguments were not provided: Usage: 04_03_relations[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] -For more information try --help +For more information try '--help' $ 04_03_relations --major Version: 2.2.3 @@ -35,7 +35,7 @@ error: The argument '--major' cannot be used with '--minor' Usage: 04_03_relations[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] -For more information try --help +For more information try '--help' $ 04_03_relations --major -c config.toml ? failed @@ -44,7 +44,7 @@ error: The following required arguments were not provided: Usage: 04_03_relations[EXE] -c <--set-ver |--major|--minor|--patch> > -For more information try --help +For more information try '--help' $ 04_03_relations --major -c config.toml --spec-in input.txt Version: 2.2.3 diff --git a/examples/tutorial_builder/04_04_custom.md b/examples/tutorial_builder/04_04_custom.md index 594454b712b..64e38b5f001 100644 --- a/examples/tutorial_builder/04_04_custom.md +++ b/examples/tutorial_builder/04_04_custom.md @@ -23,7 +23,7 @@ error: Can only modify one version field Usage: 04_04_custom[EXE] [OPTIONS] [INPUT_FILE] -For more information try --help +For more information try '--help' $ 04_04_custom --major Version: 2.2.3 @@ -34,7 +34,7 @@ error: Can only modify one version field 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 ? failed @@ -43,7 +43,7 @@ error: INPUT_FILE or --spec-in is required when using --config 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 Version: 2.2.3 diff --git a/examples/tutorial_derive/04_01_enum.md b/examples/tutorial_derive/04_01_enum.md index d23f9bbd32d..f6f397798e1 100644 --- a/examples/tutorial_derive/04_01_enum.md +++ b/examples/tutorial_derive/04_01_enum.md @@ -22,6 +22,6 @@ $ 04_01_enum_derive medium error: "medium" isn't a valid value for '' [possible values: fast, slow] -For more information try --help +For more information try '--help' ``` diff --git a/examples/tutorial_derive/04_02_parse.md b/examples/tutorial_derive/04_02_parse.md index 39d960f263c..d73256bcb37 100644 --- a/examples/tutorial_derive/04_02_parse.md +++ b/examples/tutorial_derive/04_02_parse.md @@ -18,12 +18,12 @@ $ 04_02_parse_derive foobar ? failed error: Invalid value "foobar" for '': invalid digit found in string -For more information try --help +For more information try '--help' $ 04_02_parse_derive 0 ? failed error: Invalid value "0" for '': 0 is not in 1..=65535 -For more information try --help +For more information try '--help' ``` diff --git a/examples/tutorial_derive/04_02_validate.md b/examples/tutorial_derive/04_02_validate.md index 02fec4dfa43..094a1f1f716 100644 --- a/examples/tutorial_derive/04_02_validate.md +++ b/examples/tutorial_derive/04_02_validate.md @@ -18,12 +18,12 @@ $ 04_02_validate_derive foobar ? failed error: Invalid value "foobar" for '': `foobar` isn't a port number -For more information try --help +For more information try '--help' $ 04_02_validate_derive 0 ? failed error: Invalid value "0" for '': Port not in range 1-65535 -For more information try --help +For more information try '--help' ``` diff --git a/examples/tutorial_derive/04_03_relations.md b/examples/tutorial_derive/04_03_relations.md index 17fa8a4854f..47703347033 100644 --- a/examples/tutorial_derive/04_03_relations.md +++ b/examples/tutorial_derive/04_03_relations.md @@ -24,7 +24,7 @@ error: The following required arguments were not provided: Usage: 04_03_relations_derive[EXE] <--set-ver |--major|--minor|--patch> [INPUT_FILE] -For more information try --help +For more information try '--help' $ 04_03_relations_derive --major 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 |--major|--minor|--patch> [INPUT_FILE] -For more information try --help +For more information try '--help' $ 04_03_relations_derive --major -c config.toml ? failed @@ -44,7 +44,7 @@ error: The following required arguments were not provided: Usage: 04_03_relations_derive[EXE] -c <--set-ver |--major|--minor|--patch> > -For more information try --help +For more information try '--help' $ 04_03_relations_derive --major -c config.toml --spec-in input.txt Version: 2.2.3 diff --git a/examples/tutorial_derive/04_04_custom.md b/examples/tutorial_derive/04_04_custom.md index e2e0d3b3ca2..a68a914b04f 100644 --- a/examples/tutorial_derive/04_04_custom.md +++ b/examples/tutorial_derive/04_04_custom.md @@ -23,7 +23,7 @@ error: Can only modify one version field Usage: clap [OPTIONS] [INPUT_FILE] -For more information try --help +For more information try '--help' $ 04_04_custom_derive --major Version: 2.2.3 @@ -34,7 +34,7 @@ error: Can only modify one version field Usage: clap [OPTIONS] [INPUT_FILE] -For more information try --help +For more information try '--help' $ 04_04_custom_derive --major -c config.toml ? failed @@ -43,7 +43,7 @@ error: INPUT_FILE or --spec-in is required when using --config 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 Version: 2.2.3 diff --git a/examples/typed-derive.md b/examples/typed-derive.md index cf20f77267d..4418fe5ba65 100644 --- a/examples/typed-derive.md +++ b/examples/typed-derive.md @@ -24,7 +24,7 @@ $ typed-derive -O plaid ? failed error: Invalid value "plaid" for '-O ': invalid digit found in string -For more information try --help +For more information try '--help' ``` @@ -44,7 +44,7 @@ $ typed-derive --bind localhost ? failed error: Invalid value "localhost" for '--bind ': invalid IP address syntax -For more information try --help +For more information try '--help' ``` @@ -57,7 +57,7 @@ $ typed-derive --sleep forever ? failed error: Invalid value "forever" for '--sleep ': expected number at 0 -For more information try --help +For more information try '--help' ``` @@ -70,12 +70,12 @@ $ typed-derive -D Foo ? failed error: Invalid value "Foo" for '-D ': invalid KEY=value: no `=` found in `Foo` -For more information try --help +For more information try '--help' $ typed-derive -D Foo=Bar ? failed error: Invalid value "Foo=Bar" for '-D ': invalid digit found in string -For more information try --help +For more information try '--help' ``` diff --git a/src/error/format.rs b/src/error/format.rs index 5f4ba4255f3..44fc2cb72cd 100644 --- a/src/error/format.rs +++ b/src/error/format.rs @@ -442,9 +442,9 @@ pub(crate) fn get_help_flag(cmd: &Command) -> Option<&'static str> { fn try_help(styled: &mut StyledStr, help: Option<&str>) { if let Some(help) = help { - styled.none("\n\nFor more information try "); + styled.none("\n\nFor more information try '"); styled.good(help.to_owned()); - styled.none("\n"); + styled.none("'\n"); } else { styled.none("\n"); } diff --git a/tests/builder/conflicts.rs b/tests/builder/conflicts.rs index fc919a5fc82..c3b062f3aac 100644 --- a/tests/builder/conflicts.rs +++ b/tests/builder/conflicts.rs @@ -277,7 +277,7 @@ error: The argument '--flag...' cannot be used with '-F' Usage: clap-test --flag... --long-option-2 [positional3]... -For more information try --help +For more information try '--help' "; utils::assert_output( @@ -295,7 +295,7 @@ error: The argument '-F' cannot be used with '--flag...' Usage: clap-test -F --long-option-2 [positional3]... -For more information try --help +For more information try '--help' "; utils::assert_output( @@ -313,7 +313,7 @@ error: The argument '--flag...' cannot be used with '-F' Usage: clap-test --flag... --long-option-2 [positional3]... -For more information try --help +For more information try '--help' "; utils::assert_output( @@ -331,7 +331,7 @@ error: The argument '-F' cannot be used with '--flag...' Usage: clap-test -F --long-option-2 [positional3]... -For more information try --help +For more information try '--help' "; utils::assert_output( @@ -351,7 +351,7 @@ error: The argument '--one' cannot be used with: Usage: three_conflicting_arguments --one -For more information try --help +For more information try '--help' "; let cmd = Command::new("three_conflicting_arguments") diff --git a/tests/builder/default_vals.rs b/tests/builder/default_vals.rs index f2c7769a922..0cd6763061d 100644 --- a/tests/builder/default_vals.rs +++ b/tests/builder/default_vals.rs @@ -713,7 +713,7 @@ error: The following required arguments were not provided: Usage: bug -For more information try --help +For more information try '--help' ", true, ); diff --git a/tests/builder/double_require.rs b/tests/builder/double_require.rs index 1a83d1b9d58..d191ac9865b 100644 --- a/tests/builder/double_require.rs +++ b/tests/builder/double_require.rs @@ -16,7 +16,7 @@ error: The following required arguments were not provided: Usage: prog -b -c -For more information try --help +For more information try '--help' "; static ONLY_C_ERROR: &str = "\ @@ -25,7 +25,7 @@ error: The following required arguments were not provided: Usage: prog -c -b -For more information try --help +For more information try '--help' "; fn cmd() -> Command { diff --git a/tests/builder/empty_values.rs b/tests/builder/empty_values.rs index ba338a764e5..38ffb293b2e 100644 --- a/tests/builder/empty_values.rs +++ b/tests/builder/empty_values.rs @@ -120,7 +120,7 @@ fn no_empty_values_without_equals_but_requires_equals() { Usage: config [OPTIONS] -For more information try --help +For more information try '--help' "; utils::assert_output(cmd, "config --config", NO_EUQALS_ERROR, true); diff --git a/tests/builder/error.rs b/tests/builder/error.rs index 611cf4d654b..2db329d80b3 100644 --- a/tests/builder/error.rs +++ b/tests/builder/error.rs @@ -27,7 +27,7 @@ fn app_error() { Usage: test [OPTIONS] --all -For more information try --help +For more information try '--help' "; let cmd = Command::new("test") .arg( @@ -139,7 +139,7 @@ error: Found argument 'unused' which wasn't expected, or isn't valid in this con Usage: test -For more information try --help +For more information try '--help' "; assert_error(err, expected_kind, MESSAGE, true); } diff --git a/tests/builder/flags.rs b/tests/builder/flags.rs index c0afc4ee595..e92d97571fc 100644 --- a/tests/builder/flags.rs +++ b/tests/builder/flags.rs @@ -8,7 +8,7 @@ error: Found argument '--another-flag' which wasn't expected, or isn't valid in Usage: mycat [OPTIONS] [filename] -For more information try --help +For more information try '--help' "; #[test] @@ -184,7 +184,7 @@ error: Found argument '-----' which wasn't expected, or isn't valid in this cont Usage: test -For more information try --help +For more information try '--help' "; let cmd = Command::new("test").arg(Arg::new("arg").action(ArgAction::Set).required(true)); diff --git a/tests/builder/groups.rs b/tests/builder/groups.rs index c5c6aba3306..99ac9fec94f 100644 --- a/tests/builder/groups.rs +++ b/tests/builder/groups.rs @@ -7,7 +7,7 @@ static REQ_GROUP_USAGE: &str = "error: The following required arguments were not Usage: clap-test -For more information try --help +For more information try '--help' "; static REQ_GROUP_CONFLICT_USAGE: &str = "\ @@ -15,7 +15,7 @@ error: The argument '--delete' cannot be used with '[base]' Usage: clap-test -For more information try --help +For more information try '--help' "; static REQ_GROUP_CONFLICT_ONLY_OPTIONS: &str = "\ @@ -23,7 +23,7 @@ error: The argument '--delete' cannot be used with '--all' Usage: clap-test <--all|--delete> -For more information try --help +For more information try '--help' "; #[test] diff --git a/tests/builder/help.rs b/tests/builder/help.rs index 53e89571d38..fdb94799842 100644 --- a/tests/builder/help.rs +++ b/tests/builder/help.rs @@ -80,7 +80,7 @@ fn help_multi_subcommand_error() { Usage: ctest subcmd multi [OPTIONS] -For more information try --help +For more information try '--help' "; utils::assert_eq(EXPECTED, err.to_string()); } diff --git a/tests/builder/opts.rs b/tests/builder/opts.rs index c47bbe2c320..8c7a836ede4 100644 --- a/tests/builder/opts.rs +++ b/tests/builder/opts.rs @@ -12,7 +12,7 @@ error: Found argument '--optio' which wasn't expected, or isn't valid in this co Usage: clap-test --option ... [positional] [positional2] [positional3]... -For more information try --help +For more information try '--help' "; #[cfg(feature = "suggestions")] @@ -25,7 +25,7 @@ error: Found argument '--files-without-matches' which wasn't expected, or isn't Usage: ripgrep-616 --files-without-match -For more information try --help +For more information try '--help' "; #[test] @@ -50,7 +50,7 @@ fn require_equals_fail_message() { Usage: prog [OPTIONS] -For more information try --help +For more information try '--help' "; let cmd = Command::new("prog").arg( Arg::new("cfg") diff --git a/tests/builder/possible_values.rs b/tests/builder/possible_values.rs index b9853610817..3bca2ffd55e 100644 --- a/tests/builder/possible_values.rs +++ b/tests/builder/possible_values.rs @@ -9,7 +9,7 @@ error: \"slo\" isn't a valid value for '-O