1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +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(); table();
Ok(()) 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<()> { fn list(signals: &Vec<String>) {
match arg { if signals.is_empty() {
Some(x) => print_signal(x), print_signals();
None => { } else {
print_signals(); for signal in signals {
Ok(()) if let Err(e) = print_signal(signal) {
uucore::show!(e)
}
} }
} }
} }