chmod: print change message to stdout, not stderr

This commit is contained in:
Michael Debertol
2021-08-25 13:52:09 +02:00
parent 080998b6ef
commit 74958794c6
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -322,7 +322,7 @@ impl Chmoder {
show_error!("{}", err);
}
if self.verbose {
show_error!(
println!(
"failed to change mode of file '{}' from {:04o} ({}) to {:04o} ({})",
file.display(),
fperm,
@@ -334,7 +334,7 @@ impl Chmoder {
Err(1)
} else {
if self.verbose || self.changes {
show_error!(
println!(
"mode of '{}' changed from {:04o} ({}) to {:04o} ({})",
file.display(),
fperm,
+2 -2
View File
@@ -330,8 +330,8 @@ fn test_chmod_recursive() {
.arg("a")
.arg("z")
.succeeds()
.stderr_contains(&"to 0333 (-wx-wx-wx)")
.stderr_contains(&"to 0222 (-w--w--w-)");
.stdout_contains(&"to 0333 (-wx-wx-wx)")
.stdout_contains(&"to 0222 (-w--w--w-)");
assert_eq!(at.metadata("z/y").permissions().mode(), 0o100222);
assert_eq!(at.metadata("a/a").permissions().mode(), 0o100222);