1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

kill: make -s conflict with -l and -t

This commit is contained in:
Samuel Tardieu 2025-01-04 11:40:21 +01:00
parent e0031565ba
commit b5fc19e60e
2 changed files with 24 additions and 1 deletions

View file

@ -125,7 +125,8 @@ pub fn uu_app() -> Command {
.short_alias('n') // For bash compatibility, like in GNU coreutils .short_alias('n') // For bash compatibility, like in GNU coreutils
.long(options::SIGNAL) .long(options::SIGNAL)
.value_name("signal") .value_name("signal")
.help("Sends given signal instead of SIGTERM"), .help("Sends given signal instead of SIGTERM")
.conflicts_with_all([options::LIST, options::TABLE]),
) )
.arg( .arg(
Arg::new(options::PIDS_OR_SIGNALS) Arg::new(options::PIDS_OR_SIGNALS)

View file

@ -307,3 +307,25 @@ fn test_kill_with_signal_number_hidden_compatibility_option() {
.succeeds(); .succeeds();
assert_eq!(target.wait_for_signal(), Some(9)); assert_eq!(target.wait_for_signal(), Some(9));
} }
#[test]
fn test_kill_with_signal_and_list() {
let target = Target::new();
new_ucmd!()
.arg("-s")
.arg("EXIT")
.arg(format!("{}", target.pid()))
.arg("-l")
.fails();
}
#[test]
fn test_kill_with_signal_and_table() {
let target = Target::new();
new_ucmd!()
.arg("-s")
.arg("EXIT")
.arg(format!("{}", target.pid()))
.arg("-t")
.fails();
}