1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

Merge pull request #7070 from samueltardieu/push-ozkqollptyzw

kill: make `-s` conflict with `-l` and `-t`
This commit is contained in:
Daniel Hofstetter 2025-01-04 15:32:44 +01:00 committed by GitHub
commit fbea7c41ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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
.long(options::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::new(options::PIDS_OR_SIGNALS)

View file

@ -307,3 +307,25 @@ fn test_kill_with_signal_number_hidden_compatibility_option() {
.succeeds();
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();
}