Use -k for kill process

This commit is contained in:
aNNiMON 2024-08-02 22:23:11 +03:00
parent b0814b8a83
commit 6fe5da3f51

View File

@ -111,13 +111,13 @@ fn main() -> ExitCode {
}
Mode::Help => {
let lines = [
"pkill => all unique processed, excl. system\n",
"pkill <name> => filtered processes by name or it's part\n",
"pkill -a/--all => all processes, incl. system\n",
"pkill -t/--tree => all processes as tree\n",
"pkill -p/--pid <name> => PID of the first occurence\n",
"pkill -k1/--kill <PID>/<name> => terminate process by its PID or name\n",
"pkill -h/--help => print help\n",
"pkill => all unique processed, excl. system\n",
"pkill <name> => filtered processes by name or it's part\n",
"pkill -a/--all => all processes, incl. system\n",
"pkill -t/--tree => all processes as tree\n",
"pkill -p/--pid <name> => PID of the first occurence\n",
"pkill -k/--kill <PID>/<name> => terminate process by its PID or name\n",
"pkill -h/--help => print help\n",
];
println!("{}", lines.concat());
ExitCode::SUCCESS
@ -140,7 +140,7 @@ fn parse_mode() -> Mode {
continue;
}
}
"-k1" | "--kill" => {
"-k" | "--kill" => {
if let Some(name) = iter.next() {
mode = match name.parse() {
Ok(pid) => Mode::TerminateByPid(pid),