mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
mv: add 'renamed ' in the beginning when verbose flag is set
This commit is contained in:
parent
6f0e4ece9d
commit
d4630c83b4
2 changed files with 9 additions and 5 deletions
|
@ -455,12 +455,12 @@ fn rename(
|
||||||
if b.verbose {
|
if b.verbose {
|
||||||
let message = match backup_path {
|
let message = match backup_path {
|
||||||
Some(path) => format!(
|
Some(path) => format!(
|
||||||
"{} -> {} (backup: {})",
|
"renamed {} -> {} (backup: {})",
|
||||||
from.quote(),
|
from.quote(),
|
||||||
to.quote(),
|
to.quote(),
|
||||||
path.quote()
|
path.quote()
|
||||||
),
|
),
|
||||||
None => format!("{} -> {}", from.quote(), to.quote()),
|
None => format!("renamed {} -> {}", from.quote(), to.quote()),
|
||||||
};
|
};
|
||||||
|
|
||||||
match multi_progress {
|
match multi_progress {
|
||||||
|
|
|
@ -745,7 +745,9 @@ fn test_mv_backup_dir() {
|
||||||
.arg(dir_a)
|
.arg(dir_a)
|
||||||
.arg(dir_b)
|
.arg(dir_b)
|
||||||
.succeeds()
|
.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_a));
|
||||||
assert!(at.dir_exists(dir_b));
|
assert!(at.dir_exists(dir_b));
|
||||||
|
@ -817,7 +819,7 @@ fn test_mv_verbose() {
|
||||||
.arg(file_a)
|
.arg(file_a)
|
||||||
.arg(file_b)
|
.arg(file_b)
|
||||||
.succeeds()
|
.succeeds()
|
||||||
.stdout_only(format!("'{file_a}' -> '{file_b}'\n"));
|
.stdout_only(format!("renamed '{file_a}' -> '{file_b}'\n"));
|
||||||
|
|
||||||
at.touch(file_a);
|
at.touch(file_a);
|
||||||
scene
|
scene
|
||||||
|
@ -826,7 +828,9 @@ fn test_mv_verbose() {
|
||||||
.arg(file_a)
|
.arg(file_a)
|
||||||
.arg(file_b)
|
.arg(file_b)
|
||||||
.succeeds()
|
.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]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue