1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

chmod: print change message to stdout, not stderr

This commit is contained in:
Michael Debertol 2021-08-16 00:18:45 +02:00
parent 080998b6ef
commit 74958794c6
2 changed files with 4 additions and 4 deletions

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,

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);