mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
Merge pull request #5347 from cakebaker/mv_show_no_skipped_message
mv: show no "skipped" msg with -vi/-vin
This commit is contained in:
commit
0f248d7525
2 changed files with 4 additions and 11 deletions
|
@ -448,19 +448,11 @@ fn rename(
|
||||||
|
|
||||||
match b.overwrite {
|
match b.overwrite {
|
||||||
OverwriteMode::NoClobber => {
|
OverwriteMode::NoClobber => {
|
||||||
let err_msg = if b.verbose {
|
let err_msg = format!("not replacing {}", to.quote());
|
||||||
println!("skipped {}", to.quote());
|
|
||||||
String::new()
|
|
||||||
} else {
|
|
||||||
format!("not replacing {}", to.quote())
|
|
||||||
};
|
|
||||||
return Err(io::Error::new(io::ErrorKind::Other, err_msg));
|
return Err(io::Error::new(io::ErrorKind::Other, err_msg));
|
||||||
}
|
}
|
||||||
OverwriteMode::Interactive => {
|
OverwriteMode::Interactive => {
|
||||||
if !prompt_yes!("overwrite {}?", to.quote()) {
|
if !prompt_yes!("overwrite {}?", to.quote()) {
|
||||||
if b.verbose {
|
|
||||||
println!("skipped {}", to.quote());
|
|
||||||
}
|
|
||||||
return Err(io::Error::new(io::ErrorKind::Other, ""));
|
return Err(io::Error::new(io::ErrorKind::Other, ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1350,7 +1350,7 @@ fn test_mv_arg_interactive_skipped() {
|
||||||
.ignore_stdin_write_error()
|
.ignore_stdin_write_error()
|
||||||
.fails()
|
.fails()
|
||||||
.stderr_is("mv: overwrite 'b'? ")
|
.stderr_is("mv: overwrite 'b'? ")
|
||||||
.stdout_is("skipped 'b'\n");
|
.no_stdout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1360,7 +1360,8 @@ fn test_mv_arg_interactive_skipped_vin() {
|
||||||
at.touch("b");
|
at.touch("b");
|
||||||
ucmd.args(&["-vin", "a", "b"])
|
ucmd.args(&["-vin", "a", "b"])
|
||||||
.fails()
|
.fails()
|
||||||
.stdout_is("skipped 'b'\n");
|
.stderr_is("mv: not replacing 'b'\n")
|
||||||
|
.no_stdout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue