Skip to content

Commit

Permalink
Merge pull request #5684 from allaboutevemirolive/v10_expand
Browse files Browse the repository at this point in the history
expand: fix duplicate flags
  • Loading branch information
sylvestre committed Dec 21, 2023
2 parents 95852db + f874788 commit e071fd3
Show file tree
Hide file tree
Showing 2 changed files with 18 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
17 changes: 17 additions & 0 deletions tests/by-util/test_expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,20 @@ fn test_comma_with_plus_4() {
// 01234567890
.stdout_is("a b c");
}

#[test]
fn test_args_override() {
new_ucmd!()
.args(&["-i", "-i", "with-trailing-tab.txt"])
.run()
.stdout_is(
"// !note: file contains significant whitespace
// * indentation uses <TAB> characters
int main() {
// * next line has both a leading & trailing tab
// with tabs=>
return 0;
}
",
);
}

0 comments on commit e071fd3

Please sign in to comment.