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

kill: support multiple signals for --list

This commit is contained in:
Haisham 2024-04-10 18:01:47 +05:00 committed by Ben Wiederhake
parent 9d82fa3b9a
commit 693149d683

View file

@ -71,7 +71,10 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
table();
Ok(())
}
Mode::List => list(pids_or_signals.first()),
Mode::List => {
list(&pids_or_signals);
Ok(())
}
}
}
@ -164,12 +167,14 @@ fn print_signals() {
}
}
fn list(arg: Option<&String>) -> UResult<()> {
match arg {
Some(x) => print_signal(x),
None => {
print_signals();
Ok(())
fn list(signals: &Vec<String>) {
if signals.is_empty() {
print_signals();
} else {
for signal in signals {
if let Err(e) = print_signal(signal) {
uucore::show!(e)
}
}
}
}