fix(error): Quote literals consistently

This commit is contained in:
Ed Page 2022-09-29 08:54:03 -05:00
parent 2d86f96d64
commit 5399f49572
6 changed files with 17 additions and 17 deletions

View file

@ -37,7 +37,7 @@ $ interop_augment_args --unknown
? failed ? failed
error: Found argument '--unknown' which wasn't expected, or isn't valid in this context error: Found argument '--unknown' which wasn't expected, or isn't valid in this context
If you tried to supply `--unknown` as a value rather than a flag, use `-- --unknown` 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]
@ -74,7 +74,7 @@ $ interop_augment_subcommands derived --unknown
? failed ? failed
error: Found argument '--unknown' which wasn't expected, or isn't valid in this context error: Found argument '--unknown' which wasn't expected, or isn't valid in this context
If you tried to supply `--unknown` as a value rather than a flag, use `-- --unknown` 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]
@ -146,7 +146,7 @@ $ interop_hand_subcommand add --unknown
? failed ? failed
error: Found argument '--unknown' which wasn't expected, or isn't valid in this context error: Found argument '--unknown' which wasn't expected, or isn't valid in this context
If you tried to supply `--unknown` as a value rather than a flag, use `-- --unknown` 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]...
@ -245,7 +245,7 @@ $ interop_flatten_hand_args --unknown
? failed ? failed
error: Found argument '--unknown' which wasn't expected, or isn't valid in this context error: Found argument '--unknown' which wasn't expected, or isn't valid in this context
If you tried to supply `--unknown` as a value rather than a flag, use `-- --unknown` 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]

View file

@ -357,21 +357,21 @@ fn write_dynamic_context(error: &crate::error::Error, styled: &mut StyledStr) ->
if invalid_arg.starts_with('-') { if invalid_arg.starts_with('-') {
styled.none("\n\n"); styled.none("\n\n");
styled.none(TAB); styled.none(TAB);
styled.none("If you tried to supply `"); styled.none("If you tried to supply '");
styled.warning(invalid_arg); styled.warning(invalid_arg);
styled.none("` as a value rather than a flag, use `"); styled.none("' as a value rather than a flag, use '");
styled.good("-- "); styled.good("-- ");
styled.good(invalid_arg); styled.good(invalid_arg);
styled.none("`"); styled.none("'");
} }
let trailing_arg = error.get(ContextKind::TrailingArg); let trailing_arg = error.get(ContextKind::TrailingArg);
if trailing_arg == Some(&ContextValue::Bool(true)) { if trailing_arg == Some(&ContextValue::Bool(true)) {
styled.none("\n\n"); styled.none("\n\n");
styled.none(TAB); styled.none(TAB);
styled.none("If you tried to supply `"); styled.none("If you tried to supply '");
styled.warning(invalid_arg); styled.warning(invalid_arg);
styled.none("` as a subcommand, remove the '"); styled.none("' as a subcommand, remove the '");
styled.warning("--"); styled.warning("--");
styled.none("' before it."); styled.none("' before it.");
} }

View file

@ -160,7 +160,7 @@ fn issue_1284_argument_in_flag_style() {
const USE_FLAG_AS_ARGUMENT: &str = "\ const USE_FLAG_AS_ARGUMENT: &str = "\
error: Found argument '--another-flag' which wasn't expected, or isn't valid in this context error: Found argument '--another-flag' which wasn't expected, or isn't valid in this context
If you tried to supply `--another-flag` as a value rather than a flag, use `-- --another-flag` If you tried to supply '--another-flag' as a value rather than a flag, use '-- --another-flag'
Usage: mycat [OPTIONS] [filename] Usage: mycat [OPTIONS] [filename]
@ -204,7 +204,7 @@ fn issue_2308_multiple_dashes() {
static MULTIPLE_DASHES: &str = "\ static MULTIPLE_DASHES: &str = "\
error: Found argument '-----' which wasn't expected, or isn't valid in this context error: Found argument '-----' which wasn't expected, or isn't valid in this context
If you tried to supply `-----` as a value rather than a flag, use `-- -----` If you tried to supply '-----' as a value rather than a flag, use '-- -----'
Usage: test <arg> Usage: test <arg>

View file

@ -451,7 +451,7 @@ error: Found argument '--optio' which wasn't expected, or isn't valid in this co
Did you mean '--option'? Did you mean '--option'?
If you tried to supply `--optio` as a value rather than a flag, use `-- --optio` If you tried to supply '--optio' as a value rather than a flag, use '-- --optio'
Usage: clap-test --option <opt>... [positional] [positional2] [positional3]... Usage: clap-test --option <opt>... [positional] [positional2] [positional3]...
@ -551,7 +551,7 @@ error: Found argument '--files-without-matches' which wasn't expected, or isn't
Did you mean '--files-without-match'? Did you mean '--files-without-match'?
If you tried to supply `--files-without-matches` as a value rather than a flag, use `-- --files-without-matches` If you tried to supply '--files-without-matches' as a value rather than a flag, use '-- --files-without-matches'
Usage: ripgrep-616 --files-without-match Usage: ripgrep-616 --files-without-match

View file

@ -145,7 +145,7 @@ error: Found argument '--subcmarg' which wasn't expected, or isn't valid in this
Did you mean to put '--subcmdarg' after the subcommand 'subcmd'? Did you mean to put '--subcmdarg' after the subcommand 'subcmd'?
If you tried to supply `--subcmarg` as a value rather than a flag, use `-- --subcmarg` If you tried to supply '--subcmarg' as a value rather than a flag, use '-- --subcmarg'
Usage: dym [COMMAND] Usage: dym [COMMAND]
@ -165,7 +165,7 @@ fn subcmd_did_you_mean_output_arg_false_positives() {
static EXPECTED: &str = "\ static EXPECTED: &str = "\
error: Found argument '--subcmarg' which wasn't expected, or isn't valid in this context error: Found argument '--subcmarg' which wasn't expected, or isn't valid in this context
If you tried to supply `--subcmarg` as a value rather than a flag, use `-- --subcmarg` If you tried to supply '--subcmarg' as a value rather than a flag, use '-- --subcmarg'
Usage: dym [COMMAND] Usage: dym [COMMAND]
@ -359,7 +359,7 @@ fn subcommand_used_after_double_dash() {
static SUBCMD_AFTER_DOUBLE_DASH: &str = "\ static SUBCMD_AFTER_DOUBLE_DASH: &str = "\
error: Found argument 'subcmd' which wasn't expected, or isn't valid in this context error: Found argument 'subcmd' which wasn't expected, or isn't valid in this context
If you tried to supply `subcmd` as a subcommand, remove the '--' before it. If you tried to supply 'subcmd' as a subcommand, remove the '--' before it.
Usage: cmd [COMMAND] Usage: cmd [COMMAND]

View file

@ -5,7 +5,7 @@ stdout = ""
stderr = """ stderr = """
error: Found argument '--unknown-argument' which wasn't expected, or isn't valid in this context error: Found argument '--unknown-argument' which wasn't expected, or isn't valid in this context
If you tried to supply `--unknown-argument` as a value rather than a flag, use `-- --unknown-argument` If you tried to supply '--unknown-argument' as a value rather than a flag, use '-- --unknown-argument'
Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND] Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND]