diff --git a/clap-tests/run_tests.py b/clap-tests/run_tests.py index b6747d46fed..c3d0119de5d 100755 --- a/clap-tests/run_tests.py +++ b/clap-tests/run_tests.py @@ -35,18 +35,21 @@ help Prints this message subcmd tests subcommands''' -_sc_dym_usage = '''Subcommand "subcm" is unknown. Did you mean "subcmd" ? +_sc_dym_usage = '''Subcommand "subcm" isn't valid +\tDid you mean "subcmd" ? USAGE: \tclaptests [POSITIONAL] [FLAGS] [OPTIONS] [SUBCOMMANDS] For more information try --help''' -_arg_dym_usage = '''The argument --optio isn't valid. Did you mean --option ? +_arg_dym_usage = '''The argument --optio isn't valid +\tDid you mean --option ? USAGE: \tclaptests For more information try --help''' _pv_dym_usage = '''"slo" isn't a valid value for '--Option ' -\t[valid values: fast slow]. Did you mean "slow" ? +\t[valid values: fast slow] +\tDid you mean "slow" ? USAGE: \tclaptests --Option For more information try --help''' diff --git a/src/app.rs b/src/app.rs index 4f496edc93a..e7133ad09a3 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1231,7 +1231,7 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{ I: IntoIterator { match did_you_mean(arg, values) { Some(candidate) => { - let mut suffix = ". Did you mean ".to_string(); + let mut suffix = "\n\tDid you mean ".to_string(); match style { DidYouMeanMessageStyle::LongFlag => suffix.push_str("--"), DidYouMeanMessageStyle::EnumValue => suffix.push('"'), @@ -1371,7 +1371,7 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{ if let Some(candidate_subcommand) = did_you_mean(&arg, self.subcommands.keys()) { self.report_error( - format!("Subcommand \"{}\" is unknown. Did you mean \"{}\" ?", + format!("Subcommand \"{}\" isn't valid\n\tDid you mean \"{}\" ?", arg, candidate_subcommand), true,