Skip to content

Commit 2cc487c

Browse files
committed
sort: allow -f to be pass multiple time
Fix #5667
1 parent 6bcf4e2 commit 2cc487c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/uu/sort/src/sort.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,7 @@ pub fn uu_app() -> Command {
12801280
.infer_long_args(true)
12811281
.disable_help_flag(true)
12821282
.disable_version_flag(true)
1283+
.args_override_self(true)
12831284
.arg(
12841285
Arg::new(options::HELP)
12851286
.long(options::HELP)

tests/by-util/test_sort.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,3 +1181,11 @@ fn test_tmp_files_deleted_on_sigint() {
11811181
fn test_same_sort_mode_twice() {
11821182
new_ucmd!().args(&["-k", "2n,2n", "empty.txt"]).succeeds();
11831183
}
1184+
1185+
#[test]
1186+
fn test_args_override() {
1187+
new_ucmd!()
1188+
.args(&["-f", "-f"])
1189+
.pipe_in("foo")
1190+
.succeeds();
1191+
}

0 commit comments

Comments
 (0)