diff --git a/src/uu/expand/src/expand.rs b/src/uu/expand/src/expand.rs index 99b9d6b81..eb9766eb4 100644 --- a/src/uu/expand/src/expand.rs +++ b/src/uu/expand/src/expand.rs @@ -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) diff --git a/tests/by-util/test_expand.rs b/tests/by-util/test_expand.rs index f6802358c..1e26b3273 100644 --- a/tests/by-util/test_expand.rs +++ b/tests/by-util/test_expand.rs @@ -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 characters +int main() { + // * next line has both a leading & trailing tab + // with tabs=> + return 0; +} +", + ); +}