Use -k for kill process
This commit is contained in:
parent
b0814b8a83
commit
6fe5da3f51
16
src/main.rs
16
src/main.rs
@ -111,13 +111,13 @@ fn main() -> ExitCode {
|
|||||||
}
|
}
|
||||||
Mode::Help => {
|
Mode::Help => {
|
||||||
let lines = [
|
let lines = [
|
||||||
"pkill => all unique processed, excl. system\n",
|
"pkill => all unique processed, excl. system\n",
|
||||||
"pkill <name> => filtered processes by name or it's part\n",
|
"pkill <name> => filtered processes by name or it's part\n",
|
||||||
"pkill -a/--all => all processes, incl. system\n",
|
"pkill -a/--all => all processes, incl. system\n",
|
||||||
"pkill -t/--tree => all processes as tree\n",
|
"pkill -t/--tree => all processes as tree\n",
|
||||||
"pkill -p/--pid <name> => PID of the first occurence\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 -k/--kill <PID>/<name> => terminate process by its PID or name\n",
|
||||||
"pkill -h/--help => print help\n",
|
"pkill -h/--help => print help\n",
|
||||||
];
|
];
|
||||||
println!("{}", lines.concat());
|
println!("{}", lines.concat());
|
||||||
ExitCode::SUCCESS
|
ExitCode::SUCCESS
|
||||||
@ -140,7 +140,7 @@ fn parse_mode() -> Mode {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"-k1" | "--kill" => {
|
"-k" | "--kill" => {
|
||||||
if let Some(name) = iter.next() {
|
if let Some(name) = iter.next() {
|
||||||
mode = match name.parse() {
|
mode = match name.parse() {
|
||||||
Ok(pid) => Mode::TerminateByPid(pid),
|
Ok(pid) => Mode::TerminateByPid(pid),
|
||||||
|
Loading…
Reference in New Issue
Block a user