Skip to content

Commit

Permalink
fix duplicate flags
Browse files Browse the repository at this point in the history
  • Loading branch information
allaboutevemirolive committed Dec 20, 2023
1 parent c20f009 commit 3e61872
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/uu/expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ pub fn uu_app() -> Command {
.after_help(LONG_HELP)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.args_override_self(true)
.arg(
Arg::new(options::INITIAL)
.long(options::INITIAL)
Expand Down
14 changes: 14 additions & 0 deletions tests/by-util/test_expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,17 @@ fn test_comma_with_plus_4() {
// 01234567890
.stdout_is("a b c");
}

#[test]
fn test_args_override() {
new_ucmd!()
.args(&["-i", "-i", "alice_in_wonderland.txt"])
.run()
.stdout_is(
"Alice was beginning to get very tired of sitting by\n\
her sister on the bank, and of having nothing to do: once or twice\n\
she had peeped into the book her sister was reading, but it had no\n\
pictures or conversations in it, \"and what is the use of a book,\"\n\
thought Alice \"without pictures or conversation?\"\n",
);
}
5 changes: 5 additions & 0 deletions tests/fixtures/expand/alice_in_wonderland.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Alice was beginning to get very tired of sitting by
her sister on the bank, and of having nothing to do: once or twice
she had peeped into the book her sister was reading, but it had no
pictures or conversations in it, "and what is the use of a book,"
thought Alice "without pictures or conversation?"

0 comments on commit 3e61872

Please sign in to comment.