From f0286eb77dbb24242af95581950b7aa9f15cf46f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 30 Mar 2024 07:27:48 +0100 Subject: [PATCH] tail: allow multiple usage of --pid to match upstream (regression of 9.5) tested by tests/tail/pid --- src/uu/tail/src/args.rs | 3 ++- tests/by-util/test_tail.rs | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/uu/tail/src/args.rs b/src/uu/tail/src/args.rs index 9b172987233..6ae5e68bddb 100644 --- a/src/uu/tail/src/args.rs +++ b/src/uu/tail/src/args.rs @@ -510,7 +510,8 @@ pub fn uu_app() -> Command { Arg::new(options::PID) .long(options::PID) .value_name("PID") - .help("With -f, terminate after process ID, PID dies"), + .help("With -f, terminate after process ID, PID dies") + .overrides_with(options::PID), ) .arg( Arg::new(options::verbosity::QUIET) diff --git a/tests/by-util/test_tail.rs b/tests/by-util/test_tail.rs index c7ca09af8b9..cc5a76c31a1 100644 --- a/tests/by-util/test_tail.rs +++ b/tests/by-util/test_tail.rs @@ -3908,6 +3908,13 @@ fn test_args_when_settings_check_warnings_then_shows_warnings() { .args(&["--pid=1000", "--retry", "data"]) .stderr_to_stdout() .run() + .stdout_only(&expected_stdout) + .success(); + scene + .ucmd() + .args(&["--pid=1000", "--pid=1000", "--retry", "data"]) + .stderr_to_stdout() + .run() .stdout_only(expected_stdout) .success(); }