1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

mv: add 'renamed ' in the beginning when verbose flag is set

This commit is contained in:
John Shin 2023-04-25 21:27:52 -07:00
parent 6f0e4ece9d
commit d4630c83b4
2 changed files with 9 additions and 5 deletions

View file

@ -455,12 +455,12 @@ fn rename(
if b.verbose {
let message = match backup_path {
Some(path) => format!(
"{} -> {} (backup: {})",
"renamed {} -> {} (backup: {})",
from.quote(),
to.quote(),
path.quote()
),
None => format!("{} -> {}", from.quote(), to.quote()),
None => format!("renamed {} -> {}", from.quote(), to.quote()),
};
match multi_progress {

View file

@ -745,7 +745,9 @@ fn test_mv_backup_dir() {
.arg(dir_a)
.arg(dir_b)
.succeeds()
.stdout_only(format!("'{dir_a}' -> '{dir_b}' (backup: '{dir_b}~')\n"));
.stdout_only(format!(
"renamed '{dir_a}' -> '{dir_b}' (backup: '{dir_b}~')\n"
));
assert!(!at.dir_exists(dir_a));
assert!(at.dir_exists(dir_b));
@ -817,7 +819,7 @@ fn test_mv_verbose() {
.arg(file_a)
.arg(file_b)
.succeeds()
.stdout_only(format!("'{file_a}' -> '{file_b}'\n"));
.stdout_only(format!("renamed '{file_a}' -> '{file_b}'\n"));
at.touch(file_a);
scene
@ -826,7 +828,9 @@ fn test_mv_verbose() {
.arg(file_a)
.arg(file_b)
.succeeds()
.stdout_only(format!("'{file_a}' -> '{file_b}' (backup: '{file_b}~')\n"));
.stdout_only(format!(
"renamed '{file_a}' -> '{file_b}' (backup: '{file_b}~')\n"
));
}
#[test]