comm: implement and test correct handling of repeated flags

This commit is contained in:
Ben Wiederhake 2024-03-23 21:04:42 +01:00
parent 801edbbcb4
commit 884ef1f54b
2 changed files with 9 additions and 0 deletions

View file

@ -178,6 +178,7 @@ pub fn uu_app() -> Command {
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.args_override_self(true)
.arg(
Arg::new(options::COLUMN_1)
.short('1')

View file

@ -75,6 +75,14 @@ fn total_with_suppressed_regular_output() {
.stdout_is_fixture("ab_total_suppressed_regular_output.expected");
}
#[test]
fn repeated_flags() {
new_ucmd!()
.args(&["--total", "-123123", "--total", "a", "b"])
.succeeds()
.stdout_is_fixture("ab_total_suppressed_regular_output.expected");
}
#[test]
fn total_with_output_delimiter() {
new_ucmd!()