mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
refactor ~ revert to single quotes for "Try '{0 --help'"
This is a test expectation for gnu.
This commit is contained in:
parent
6ab3d27c4e
commit
5f2335829a
25 changed files with 33 additions and 33 deletions
|
@ -46,7 +46,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
if !matches.is_present(options::NAME) {
|
||||
crash!(
|
||||
1,
|
||||
"{1}\nTry `{0} --help` for more information.",
|
||||
"{1}\nTry '{0} --help' for more information.",
|
||||
execution_phrase!(),
|
||||
"missing operand"
|
||||
);
|
||||
|
@ -60,7 +60,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
if !multiple_paths && matches.occurrences_of(options::NAME) > 2 {
|
||||
crash!(
|
||||
1,
|
||||
"extra operand '{1}'\nTry `{0} --help` for more information.",
|
||||
"extra operand '{1}'\nTry '{0} --help' for more information.",
|
||||
execution_phrase!(),
|
||||
matches.values_of(options::NAME).unwrap().nth(2).unwrap()
|
||||
);
|
||||
|
|
|
@ -45,7 +45,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
Some(v) => Path::new(v),
|
||||
None => crash!(
|
||||
1,
|
||||
"Missing operand: NEWROOT\nTry `{} --help` for more information.",
|
||||
"Missing operand: NEWROOT\nTry '{} --help' for more information.",
|
||||
execution_phrase!()
|
||||
),
|
||||
};
|
||||
|
|
|
@ -99,7 +99,7 @@ quick_error! {
|
|||
NotImplemented(opt: String) { display("Option '{}' not yet implemented.", opt) }
|
||||
|
||||
/// Invalid arguments to backup
|
||||
Backup(description: String) { display("{}\nTry `{} --help` for more information.", description, execution_phrase!()) }
|
||||
Backup(description: String) { display("{}\nTry '{} --help' for more information.", description, execution_phrase!()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -422,7 +422,7 @@ Valid arguments are:
|
|||
- 'full-iso'
|
||||
- 'long-iso'
|
||||
- 'iso'
|
||||
Try `{} --help` for more information.",
|
||||
Try '{} --help' for more information.",
|
||||
s,
|
||||
execution_phrase!()
|
||||
),
|
||||
|
|
|
@ -68,7 +68,7 @@ impl Display for LnError {
|
|||
}
|
||||
Self::ExtraOperand(s) => write!(
|
||||
f,
|
||||
"extra operand '{}'\nTry `{} --help` for more information.",
|
||||
"extra operand '{}'\nTry '{} --help' for more information.",
|
||||
s,
|
||||
execution_phrase!()
|
||||
),
|
||||
|
|
|
@ -113,7 +113,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
if ch == 'p' {
|
||||
if matches.is_present("major") || matches.is_present("minor") {
|
||||
eprintln!("Fifos do not have major and minor device numbers.");
|
||||
eprintln!("Try `{} --help` for more information.", execution_phrase!());
|
||||
eprintln!("Try '{} --help' for more information.", execution_phrase!());
|
||||
1
|
||||
} else {
|
||||
_mknod(file_name, S_IFIFO | mode, 0)
|
||||
|
@ -122,7 +122,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
match (matches.value_of("major"), matches.value_of("minor")) {
|
||||
(None, None) | (_, None) | (None, _) => {
|
||||
eprintln!("Special files require major and minor device numbers.");
|
||||
eprintln!("Try `{} --help` for more information.", execution_phrase!());
|
||||
eprintln!("Try '{} --help' for more information.", execution_phrase!());
|
||||
1
|
||||
}
|
||||
(Some(major), Some(minor)) => {
|
||||
|
|
|
@ -294,7 +294,7 @@ fn exec(files: &[PathBuf], b: Behavior) -> i32 {
|
|||
if b.no_target_dir {
|
||||
show_error!(
|
||||
"mv: extra operand '{}'\n\
|
||||
Try `{} --help` for more information.",
|
||||
Try '{} --help' for more information.",
|
||||
files[2].display(),
|
||||
execution_phrase!()
|
||||
);
|
||||
|
|
|
@ -53,7 +53,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
Some(nstr) => {
|
||||
if !matches.is_present(options::COMMAND) {
|
||||
show_error!(
|
||||
"A command must be given with an adjustment.\nTry `{} --help` for more information.",
|
||||
"A command must be given with an adjustment.\nTry '{} --help' for more information.",
|
||||
execution_phrase!()
|
||||
);
|
||||
return 125;
|
||||
|
|
|
@ -69,7 +69,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
let paths = matches.values_of(options::PATH);
|
||||
let mut res = if paths.is_none() {
|
||||
show_error!(
|
||||
"missing operand\nTry `{} --help` for more information",
|
||||
"missing operand\nTry '{} --help' for more information",
|
||||
execution_phrase!()
|
||||
);
|
||||
false
|
||||
|
|
|
@ -283,7 +283,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
|
||||
if args.len() <= 1 {
|
||||
println!(
|
||||
"{0}: missing operand\nTry `{1} --help` for more information.",
|
||||
"{0}: missing operand\nTry '{1} --help' for more information.",
|
||||
util_name!(),
|
||||
execution_phrase!()
|
||||
);
|
||||
|
|
|
@ -58,7 +58,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
if files.is_empty() {
|
||||
crash!(
|
||||
1,
|
||||
"missing operand\nTry `{} --help` for more information",
|
||||
"missing operand\nTry '{} --help' for more information",
|
||||
execution_phrase!()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -70,13 +70,13 @@ impl FromStr for Number {
|
|||
Ok(n) => Ok(Number::BigInt(n)),
|
||||
Err(_) => match s.parse::<f64>() {
|
||||
Ok(value) if value.is_nan() => Err(format!(
|
||||
"invalid 'not-a-number' argument: '{}'\nTry `{} --help` for more information.",
|
||||
"invalid 'not-a-number' argument: '{}'\nTry '{} --help' for more information.",
|
||||
s,
|
||||
execution_phrase!(),
|
||||
)),
|
||||
Ok(value) => Ok(Number::F64(value)),
|
||||
Err(_) => Err(format!(
|
||||
"invalid floating point argument: '{}'\nTry `{} --help` for more information.",
|
||||
"invalid floating point argument: '{}'\nTry '{} --help' for more information.",
|
||||
s,
|
||||
execution_phrase!(),
|
||||
)),
|
||||
|
@ -121,7 +121,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
};
|
||||
if increment.is_zero() {
|
||||
show_error!(
|
||||
"invalid Zero increment value: '{}'\nTry `{} --help` for more information.",
|
||||
"invalid Zero increment value: '{}'\nTry '{} --help' for more information.",
|
||||
numbers[1],
|
||||
execution_phrase!()
|
||||
);
|
||||
|
|
|
@ -159,7 +159,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
let options = ProgramOptions::try_from(&matches).unwrap_or_else(|e| {
|
||||
crash!(
|
||||
125,
|
||||
"{}\nTry `{} --help` for more information.",
|
||||
"{}\nTry '{} --help' for more information.",
|
||||
e.0,
|
||||
execution_phrase!()
|
||||
)
|
||||
|
|
|
@ -263,7 +263,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
|
||||
if sets.is_empty() {
|
||||
show_error!(
|
||||
"missing operand\nTry `{} --help` for more information.",
|
||||
"missing operand\nTry '{} --help' for more information.",
|
||||
execution_phrase!()
|
||||
);
|
||||
return 1;
|
||||
|
@ -271,7 +271,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
|
||||
if !(delete_flag || squeeze_flag) && sets.len() < 2 {
|
||||
show_error!(
|
||||
"missing operand after '{}'\nTry `{} --help` for more information.",
|
||||
"missing operand after '{}'\nTry '{} --help' for more information.",
|
||||
sets[0],
|
||||
execution_phrase!()
|
||||
);
|
||||
|
|
|
@ -43,13 +43,13 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
if paths.is_empty() {
|
||||
crash!(
|
||||
1,
|
||||
"missing operand\nTry `{0} --help` for more information.",
|
||||
"missing operand\nTry '{0} --help' for more information.",
|
||||
execution_phrase!()
|
||||
);
|
||||
} else if paths.len() > 1 {
|
||||
crash!(
|
||||
1,
|
||||
"extra operand: '{1}'\nTry `{0} --help` for more information.",
|
||||
"extra operand: '{1}'\nTry '{0} --help' for more information.",
|
||||
execution_phrase!(),
|
||||
paths[1]
|
||||
);
|
||||
|
|
|
@ -115,7 +115,7 @@ macro_rules! show_usage_error(
|
|||
($($args:tt)+) => ({
|
||||
eprint!("{}: ", $crate::util_name!());
|
||||
eprintln!($($args)+);
|
||||
eprintln!("Try `{} --help` for more information.", $crate::execution_phrase!());
|
||||
eprintln!("Try '{} --help' for more information.", $crate::execution_phrase!());
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ pub fn gen_uumain(_args: TokenStream, stream: TokenStream) -> TokenStream {
|
|||
show_error!("{}", s);
|
||||
}
|
||||
if e.usage() {
|
||||
eprintln!("Try `{} --help` for more information.", execution_phrase!());
|
||||
eprintln!("Try '{} --help' for more information.", execution_phrase!());
|
||||
}
|
||||
e.code()
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ fn test_no_args() {
|
|||
fn test_no_args_output() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
ts.ucmd().fails().stderr_is(&format!(
|
||||
"{0}: missing operand\nTry `{1} {0} --help` for more information.",
|
||||
"{0}: missing operand\nTry '{1} {0} --help' for more information.",
|
||||
ts.util_name,
|
||||
ts.bin_path.to_string_lossy()
|
||||
));
|
||||
|
@ -131,7 +131,7 @@ fn test_too_many_args() {
|
|||
fn test_too_many_args_output() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
ts.ucmd().args(&["a", "b", "c"]).fails().stderr_is(format!(
|
||||
"{0}: extra operand 'c'\nTry `{1} {0} --help` for more information.",
|
||||
"{0}: extra operand 'c'\nTry '{1} {0} --help' for more information.",
|
||||
ts.util_name,
|
||||
ts.bin_path.to_string_lossy()
|
||||
));
|
||||
|
|
|
@ -568,7 +568,7 @@ fn test_cp_backup_no_clobber_conflicting_options() {
|
|||
.arg(TEST_HELLO_WORLD_SOURCE)
|
||||
.arg(TEST_HOW_ARE_YOU_SOURCE)
|
||||
.fails().stderr_is(&format!(
|
||||
"{0}: options --backup and --no-clobber are mutually exclusive\nTry `{1} {0} --help` for more information.",
|
||||
"{0}: options --backup and --no-clobber are mutually exclusive\nTry '{1} {0} --help' for more information.",
|
||||
ts.util_name,
|
||||
ts.bin_path.to_string_lossy()
|
||||
));
|
||||
|
|
|
@ -19,7 +19,7 @@ fn test_more_dir_arg() {
|
|||
let result = ts.ucmd().arg(".").run();
|
||||
result.failure();
|
||||
let expected_error_message = &format!(
|
||||
"{0}: '.' is a directory.\nTry `{1} {0} --help` for more information.",
|
||||
"{0}: '.' is a directory.\nTry '{1} {0} --help' for more information.",
|
||||
ts.util_name,
|
||||
ts.bin_path.to_string_lossy()
|
||||
);
|
||||
|
|
|
@ -529,7 +529,7 @@ fn test_mv_backup_no_clobber_conflicting_options() {
|
|||
.arg("file1")
|
||||
.arg("file2")
|
||||
.fails()
|
||||
.stderr_is(&format!("{0}: options --backup and --no-clobber are mutually exclusive\nTry `{1} {0} --help` for more information.",
|
||||
.stderr_is(&format!("{0}: options --backup and --no-clobber are mutually exclusive\nTry '{1} {0} --help' for more information.",
|
||||
ts.util_name,
|
||||
ts.bin_path.to_string_lossy()
|
||||
));
|
||||
|
|
|
@ -27,7 +27,7 @@ fn test_adjustment_with_no_command_should_error() {
|
|||
ts.ucmd()
|
||||
.args(&["-n", "19"])
|
||||
.run()
|
||||
.stderr_is(&format!("{0}: A command must be given with an adjustment.\nTry `{1} {0} --help` for more information.\n",
|
||||
.stderr_is(&format!("{0}: A command must be given with an adjustment.\nTry '{1} {0} --help' for more information.\n",
|
||||
ts.util_name,
|
||||
ts.bin_path.to_string_lossy()
|
||||
));
|
||||
|
|
|
@ -5,7 +5,7 @@ fn test_rejects_nan() {
|
|||
let ts = TestScenario::new(util_name!());
|
||||
|
||||
ts.ucmd().args(&["NaN"]).fails().stderr_only(format!(
|
||||
"{0}: invalid 'not-a-number' argument: 'NaN'\nTry `{1} {0} --help` for more information.",
|
||||
"{0}: invalid 'not-a-number' argument: 'NaN'\nTry '{1} {0} --help' for more information.",
|
||||
ts.util_name,
|
||||
ts.bin_path.to_string_lossy()
|
||||
));
|
||||
|
@ -16,7 +16,7 @@ fn test_rejects_non_floats() {
|
|||
let ts = TestScenario::new(util_name!());
|
||||
|
||||
ts.ucmd().args(&["foo"]).fails().stderr_only(&format!(
|
||||
"{0}: invalid floating point argument: 'foo'\nTry `{1} {0} --help` for more information.",
|
||||
"{0}: invalid floating point argument: 'foo'\nTry '{1} {0} --help' for more information.",
|
||||
ts.util_name,
|
||||
ts.bin_path.to_string_lossy()
|
||||
));
|
||||
|
|
|
@ -59,7 +59,7 @@ fn test_stdbuf_line_buffering_stdin_fails() {
|
|||
.args(&["-i", "L", "head"])
|
||||
.fails()
|
||||
.stderr_is(&format!(
|
||||
"{0}: line buffering stdin is meaningless\nTry `{1} {0} --help` for more information.",
|
||||
"{0}: line buffering stdin is meaningless\nTry '{1} {0} --help' for more information.",
|
||||
ts.util_name,
|
||||
ts.bin_path.to_string_lossy()
|
||||
));
|
||||
|
|
|
@ -24,7 +24,7 @@ fn test_unlink_multiple_files() {
|
|||
at.touch(file_b);
|
||||
|
||||
ucmd.arg(file_a).arg(file_b).fails().stderr_is(&format!(
|
||||
"{0}: extra operand: 'test_unlink_multiple_file_b'\nTry `{1} {0} --help` for more information.",
|
||||
"{0}: extra operand: 'test_unlink_multiple_file_b'\nTry '{1} {0} --help' for more information.",
|
||||
ts.util_name,
|
||||
ts.bin_path.to_string_lossy()
|
||||
));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue