From 0bc6d1618e05af67a1f16667dcf8fa486476062d Mon Sep 17 00:00:00 2001 From: Haisham <47662901+m-haisham@users.noreply.github.com> Date: Sun, 7 Apr 2024 21:42:06 +0500 Subject: [PATCH 1/2] kill: print signals vertically --- src/uu/kill/src/kill.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/kill/src/kill.rs b/src/uu/kill/src/kill.rs index 87de0ff54d3..98b919d6112 100644 --- a/src/uu/kill/src/kill.rs +++ b/src/uu/kill/src/kill.rs @@ -161,7 +161,7 @@ fn print_signal(signal_name_or_value: &str) -> UResult<()> { fn print_signals() { for (idx, signal) in ALL_SIGNALS.iter().enumerate() { if idx > 0 { - print!(" "); + println!(); } print!("{signal}"); } From f80760e856b03325365e4043001a2257e75b11f1 Mon Sep 17 00:00:00 2001 From: Haisham <47662901+m-haisham@users.noreply.github.com> Date: Sun, 7 Apr 2024 23:01:47 +0500 Subject: [PATCH 2/2] kill: removed unnecessary calls to print in print_signals --- src/uu/kill/src/kill.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/uu/kill/src/kill.rs b/src/uu/kill/src/kill.rs index 98b919d6112..abb55f84526 100644 --- a/src/uu/kill/src/kill.rs +++ b/src/uu/kill/src/kill.rs @@ -159,13 +159,9 @@ fn print_signal(signal_name_or_value: &str) -> UResult<()> { } fn print_signals() { - for (idx, signal) in ALL_SIGNALS.iter().enumerate() { - if idx > 0 { - println!(); - } - print!("{signal}"); + for signal in ALL_SIGNALS.iter() { + println!("{signal}"); } - println!(); } fn list(arg: Option<&String>) -> UResult<()> {