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:
Sylvestre Ledru 2023-04-26 08:34:42 +02:00 committed by GitHub
commit 4997851d5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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]