Repository: clap-rs/clap
Pull request #4220 (2022-09-15 21:25:17)

fix(parser): Quote the suggested help
We do it elsewhere but here it is only distinguished coloring.

Inspired by #4218

<!--
Thanks for helping out!

Please link the appropriate issue from your PR.

If you don't have an issue, we'd recommend starting with one first so the PR can focus on the
implementation (unless its an obvious bug or documentation fix that will have
little conversation).
-->



Patch:
diff --git a/examples/derive_ref/custom-bool.md b/examples/derive_ref/custom-bool.md
index 9a1d9d74..04e3ff0c 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 <FOO> <BOOM>
 
-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/escaped-positional-derive.md b/examples/escaped-positional-derive.md
index 8b957a6c..cd52add6 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] [-- <SLOP>...]
 
-For more information try --help
+For more information try '--help'
 
 ```
 
diff --git a/examples/escaped-positional.md b/examples/escaped-positional.md
index 1ebea062..6015cc37 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] [-- <SLOP>...]
 
-For more information try --help
+For more information try '--help'
 
 ```
 
diff --git a/examples/pacman.md b/examples/pacman.md
index 505a3fa3..f75ac172 100644
--- a/examples/pacman.md
+++ b/examples/pacman.md
@@ -71,7 +71,7 @@ error: The argument '--search <search>...' cannot be used with '--info'
 
 Usage: pacman[EXE] {sync|--sync|-S} --search <search>... <package>...
 
-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 405e5db8..ef67bc80 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 '<MODE>'
   [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 8ac76889..93a4b886 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 '<MODE>'
   [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 6b0b040f..75e5e18f 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 '<PORT>': 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 '<PORT>': 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 f812e918..e3ebafa3 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 '<PORT>': `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>': 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 0dda5d34..cdca1936 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 <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 <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 <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
 Version: 2.2.3
diff --git a/examples/tutorial_builder/04_04_custom.md b/examples/tutorial_builder/04_04_custom.md
index 594454b7..64e38b5f 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 d23f9bbd..f6f39779 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 '<MODE>'
   [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 39d960f2..d73256bc 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 '<PORT>': 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 '<PORT>': 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 02fec4df..094a1f1f 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 '<PORT>': `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>': 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 17fa8a48..47703347 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 <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 <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 <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
 Version: 2.2.3
diff --git a/examples/tutorial_derive/04_04_custom.md b/examples/tutorial_derive/04_04_custom.md
index e2e0d3b3..a68a914b 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 cf20f772..4418fe5b 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 <OPTIMIZATION>': 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 <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 <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 <DEFINES>': 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 <DEFINES>': 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 5f4ba425..44fc2cb7 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");
     }


Test patch:
diff --git a/examples/derive_ref/interop_tests.md b/examples/derive_ref/interop_tests.md
index 87bd7602..df2b0d25 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] <COMMAND>
 
-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/tests/builder/conflicts.rs b/tests/builder/conflicts.rs
index fc919a5f..c3b062f3 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 <option2> <positional> <positional2> [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 <option2> <positional> <positional2> [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 <option2> <positional> <positional2> [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 <option2> <positional> <positional2> [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 f2c7769a..0cd67630 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 <input>
 
-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 1a83d1b9..d191ac98 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 ba338a76..38ffb293 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 611cf4d6..2db329d8 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 c0afc4ee..e92d9757 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 <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));
 
diff --git a/tests/builder/groups.rs b/tests/builder/groups.rs
index c5c6aba3..99ac9fec 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 <base|--delete>
 
-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 <base|--delete>
 
-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 53e89571..fdb94799 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 c47bbe2c..8c7a836e 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 <opt>... [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 b9853610..3bca2ffd 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 <option>'
 
   Did you mean \"slow\"?
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[cfg(not(feature = "suggestions"))]
@@ -17,7 +17,7 @@ static PV_ERROR: &str = "\
 error: \"slo\" isn't a valid value for '-O <option>'
   [possible values: slow, fast, \"ludicrous speed\"]
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[cfg(feature = "suggestions")]
@@ -27,7 +27,7 @@ error: \"ludicrous\" isn't a valid value for '-O <option>'
 
   Did you mean \"ludicrous speed\"?
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[cfg(not(feature = "suggestions"))]
@@ -35,7 +35,7 @@ static PV_ERROR_ESCAPED: &str = "\
 error: \"ludicrous\" isn't a valid value for '-O <option>'
   [possible values: slow, fast, \"ludicrous speed\"]
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[test]
@@ -301,7 +301,7 @@ static MISSING_PV_ERROR: &str = "\
 error: The argument '-O <option>' requires a value but none was supplied
   [possible values: slow, fast, \"ludicrous speed\"]
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[test]
diff --git a/tests/builder/require.rs b/tests/builder/require.rs
index 7e85df1b..1a589a06 100644
--- a/tests/builder/require.rs
+++ b/tests/builder/require.rs
@@ -9,7 +9,7 @@ error: The following required arguments were not provided:
 
 Usage: clap-test --opt=<FILE>
 
-For more information try --help
+For more information try '--help'
 ";
 
 static REQUIRE_EQUALS_FILTERED: &str = "\
@@ -18,7 +18,7 @@ error: The following required arguments were not provided:
 
 Usage: clap-test --opt=<FILE> --foo=<FILE>
 
-For more information try --help
+For more information try '--help'
 ";
 
 static REQUIRE_EQUALS_FILTERED_GROUP: &str = "\
@@ -27,7 +27,7 @@ error: The following required arguments were not provided:
 
 Usage: clap-test --opt=<FILE> --foo=<FILE> <--g1=<FILE>|--g2=<FILE>>
 
-For more information try --help
+For more information try '--help'
 ";
 
 static MISSING_REQ: &str = "\
@@ -38,7 +38,7 @@ error: The following required arguments were not provided:
 
 Usage: clap-test --long-option-2 <option2> -F <positional> <positional2> [positional3]...
 
-For more information try --help
+For more information try '--help'
 ";
 
 static COND_REQ_IN_USAGE: &str = "\
@@ -47,7 +47,7 @@ error: The following required arguments were not provided:
 
 Usage: test --target <target> --input <input> --output <output>
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[test]
@@ -143,7 +143,7 @@ error: The following required arguments were not provided:
 
 Usage: clap-test <flag> <opt> [bar]
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[test]
@@ -162,7 +162,7 @@ error: The following required arguments were not provided:
 
 Usage: clap-test <flag> [opt] [bar]
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[test]
@@ -183,7 +183,7 @@ error: The following required arguments were not provided:
 
 Usage: clap-test <flag> <foo> <opt> [bar]
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[test]
@@ -1028,7 +1028,7 @@ error: The following required arguments were not provided:
 
 Usage: example -x <X> -y <Y> -z <Z> <ID>
 
-For more information try --help
+For more information try '--help'
 ";
 
 fn issue_1158_app() -> Command {
@@ -1062,7 +1062,7 @@ error: The following required arguments were not provided:
 
 Usage: test --c <c> --a <a> --b <b>
 
-For more information try --help
+For more information try '--help'
 ";
     let cmd = Command::new("test")
         .arg(
@@ -1429,7 +1429,7 @@ error: The argument '-b <b>' cannot be used with '-c <c>'
 
 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);
 }
@@ -1451,7 +1451,7 @@ error: The following required arguments were not provided:
 
 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);
 }
diff --git a/tests/builder/subcommands.rs b/tests/builder/subcommands.rs
index 937a2475..f8e8a181 100644
--- a/tests/builder/subcommands.rs
+++ b/tests/builder/subcommands.rs
@@ -36,7 +36,7 @@ If you believe you received this message in error, try re-running with 'dym -- s
 
 Usage: dym [COMMAND]
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[cfg(feature = "suggestions")]
@@ -49,7 +49,7 @@ If you believe you received this message in error, try re-running with 'dym -- t
 
 Usage: dym [COMMAND]
 
-For more information try --help
+For more information try '--help'
 ";
 
 static SUBCMD_AFTER_DOUBLE_DASH: &str = "\
@@ -59,7 +59,7 @@ error: Found argument 'subcmd' which wasn't expected, or isn't valid in this con
 
 Usage: cmd [COMMAND]
 
-For more information try --help
+For more information try '--help'
 ";
 
 #[test]
@@ -180,7 +180,7 @@ error: Found argument '--subcmarg' which wasn't expected, or isn't valid in this
 
 Usage: dym [COMMAND]
 
-For more information try --help
+For more information try '--help'
 ";
 
     let cmd = Command::new("dym")
@@ -199,7 +199,7 @@ error: Found argument '--subcmarg' which wasn't expected, or isn't valid in this
 
 Usage: dym [COMMAND]
 
-For more information try --help
+For more information try '--help'
 ";
 
     let cmd = Command::new("dym")
@@ -433,7 +433,7 @@ fn subcommand_not_recognized() {
 
 Usage: fake [COMMAND]
 
-For more information try --help
+For more information try '--help'
 ",
         true,
     );
@@ -509,7 +509,7 @@ error: The subcommand 'world' wasn't recognized
 
 Usage: <COMMAND>
 
-For more information try help
+For more information try 'help'
 ";
     utils::assert_eq(HELLO_EXPECTED, err.to_string());
 
@@ -526,7 +526,7 @@ If you believe you received this message in error, try re-running with ' -- baz'
 
 Usage: <COMMAND>
 
-For more information try help
+For more information try 'help'
 ";
         utils::assert_eq(BAZ_EXPECTED, err.to_string());
     }
diff --git a/tests/derive/help.rs b/tests/derive/help.rs
index d4447967..dc925d74 100644
--- a/tests/derive/help.rs
+++ b/tests/derive/help.rs
@@ -223,7 +223,7 @@ fn derive_generated_error_has_full_context() {
 Usage: clap --req-str <REQ_STR>
        clap <COMMAND>
 
-For more information try --help
+For more information try '--help'
 "#;
     assert_eq!(result.unwrap_err().to_string(), expected);
 }
diff --git a/tests/ui/error_stderr.toml b/tests/ui/error_stderr.toml
index 8271a0a7..364984de 100644
--- a/tests/ui/error_stderr.toml
+++ b/tests/ui/error_stderr.toml
@@ -9,5 +9,5 @@ error: Found argument '--unknown-argument' which wasn't expected, or isn't valid
 
 Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND]
 
-For more information try --help
+For more information try '--help'
 """