Skip to content

Commit

Permalink
Merge pull request #4410 from dmatos2012/chmod-override-quiet-verbose…
Browse files Browse the repository at this point in the history
…-opts

chmod: allow verbose and quiet flags to be used more than once
  • Loading branch information
sylvestre authored Feb 23, 2023
2 parents 1ab1035 + d9a21ff commit c99accc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/uu/chmod/src/chmod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ pub fn uu_app() -> Command {
.version(crate_version!())
.about(ABOUT)
.override_usage(format_usage(USAGE))
.args_override_self(true)
.infer_long_args(true)
.arg(
Arg::new(options::CHANGES)
Expand Down
21 changes: 21 additions & 0 deletions tests/by-util/test_chmod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,3 +650,24 @@ fn test_chmod_file_symlink_after_non_existing_file() {
0o100764
);
}

#[test]
fn test_quiet_n_verbose_used_multiple_times() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.touch("file");
scene
.ucmd()
.arg("u+x")
.arg("--verbose")
.arg("--verbose")
.arg("file")
.succeeds();
scene
.ucmd()
.arg("u+x")
.arg("--quiet")
.arg("--quiet")
.arg("file")
.succeeds();
}

0 comments on commit c99accc

Please sign in to comment.