mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 07:12:44 +00:00
Merge pull request #4787 from shinhs0506/mv-verbose
mv: add 'renamed " in the beginning of the message when verbose flag is set
This commit is contained in:
commit
4997851d5b
2 changed files with 9 additions and 5 deletions
|
@ -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 {
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue