From 0cbb957da9da885439df96f8be23f38238595304 Mon Sep 17 00:00:00 2001 From: aNNiMON Date: Fri, 2 Aug 2024 22:40:10 +0300 Subject: [PATCH] Release 1.0.0 --- Cargo.lock | 2 +- Cargo.toml | 9 +++++++-- LICENSE | 21 +++++++++++++++++++++ README.md | 21 +++++++++++++++++++++ src/processes.rs | 8 ++++++-- 5 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 LICENSE create mode 100644 README.md diff --git a/Cargo.lock b/Cargo.lock index 6f7a291..bda1b2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,7 +19,7 @@ dependencies = [ [[package]] name = "pkill" -version = "0.1.0" +version = "1.0.0" dependencies = [ "itertools", "windows", diff --git a/Cargo.toml b/Cargo.toml index 3d2cdb9..4e94790 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,17 @@ [package] name = "pkill" -version = "0.1.0" +version = "1.0.0" edition = "2021" +[profile.release] +strip = true +opt-level = "z" +lto = true + [dependencies] windows = { version = "0.52.0", features = [ "Win32_Foundation", "Win32_System_Diagnostics_ToolHelp", "Win32_System_Threading", ] } -itertools = "0.13.0" \ No newline at end of file +itertools = "0.13.0" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d524277 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 aNNiMON + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1fbd4ee --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +## Process Kill + +Windows utility to display and terminate processes. + +``` +❯ pkill bash +Name PID Threads +wezterm-gui.exe 6020 25 + bash.exe 9036 4 + bash.exe 1100 2 +``` + +### Usage + +- `pkill` — all unique processed, excl. system +- `pkill ` — filtered processes by name or it's part +- `pkill -a/--all` — all processes, incl. system +- `pkill -t/--tree` — all processes as tree +- `pkill -p/--pid ` — PID of the first occurence +- `pkill -k/--kill /` — terminate process by its PID or name +- `pkill -h/--help` — print help diff --git a/src/processes.rs b/src/processes.rs index 25ea1ea..4a47b3b 100644 --- a/src/processes.rs +++ b/src/processes.rs @@ -21,7 +21,11 @@ pub struct ProcessInfo { impl fmt::Display for ProcessInfo { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{:<10} {:<10} {:<8} {:<32}", self.pid, self.parent_pid, self.threads_count, self.name) + write!( + f, + "{:<10} {:<10} {:<8} {:<32}", + self.pid, self.parent_pid, self.threads_count, self.name + ) } } @@ -63,4 +67,4 @@ pub fn terminate_process(process_id: u32) -> bool { false } } -} \ No newline at end of file +}