Skip to content

Commit

Permalink
pkill: implement (#290)
Browse files Browse the repository at this point in the history
* pkill: init source

* pkill: implement

* pkill: implement `-e`

* pkill: change `&mut self` to `&self` for `status`, `stat`, `start_time`'s args

* pkill: implement `-H`

* pkill: format code

* pkill: remove .idea dir

* pkill: beautify code

* pkill: beautify code

* pkill: fix Cargo.toml

* pkill: remove duplicated process.rs

* pkill: add unit tests

* pkill: beautify code

* pkill: fix CI failures for windows

* pkill: fix CI failures for windows

* pkill: fix CI failures for windows

* pkill: fix CI failures for windows

* pkill: fix CI failures for windows

* pkill: fix CI failures for MacOS

* pkill: fix CI failures for windows

* pkill: fix CI failures for windows

---------

Co-authored-by: Krysztal Huang <[email protected]>
Co-authored-by: Sylvestre Ledru <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2025
1 parent c2c0bab commit ab6e081
Show file tree
Hide file tree
Showing 8 changed files with 505 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ feat_common_core = [
"pwdx",
"slabtop",
"snice",
"pkill",
"top",
"w",
"watch",
Expand Down Expand Up @@ -82,6 +83,7 @@ ps = { optional = true, version = "0.0.1", package = "uu_ps", path = "src/uu/ps"
pwdx = { optional = true, version = "0.0.1", package = "uu_pwdx", path = "src/uu/pwdx" }
slabtop = { optional = true, version = "0.0.1", package = "uu_slabtop", path = "src/uu/slabtop" }
snice = { optional = true, version = "0.0.1", package = "uu_snice", path = "src/uu/snice" }
pkill = { optional = true, version = "0.0.1", package = "uu_pkill", path = "src/uu/pkill" }
top = { optional = true, version = "0.0.1", package = "uu_top", path = "src/uu/top" }
w = { optional = true, version = "0.0.1", package = "uu_w", path = "src/uu/w" }
watch = { optional = true, version = "0.0.1", package = "uu_watch", path = "src/uu/watch" }
Expand Down
29 changes: 29 additions & 0 deletions src/uu/pkill/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "uu_pkill"
version = "0.0.1"
edition = "2021"
authors = ["uutils developers"]
license = "MIT"
description = "pgrep ~ (uutils) Kills processes based on name and other attributes."

homepage = "https://github.com/uutils/procps"
repository = "https://github.com/uutils/procps/tree/main/src/uu/pkill"
keywords = ["acl", "uutils", "cross-platform", "cli", "utility"]
categories = ["command-line-utilities"]


[dependencies]
uucore = { workspace = true }
clap = { workspace = true }
walkdir = { workspace = true }
regex = { workspace = true }
nix = { workspace = true, features = ["signal"] }

uu_pgrep = { path = "../pgrep" }

[lib]
path = "src/pkill.rs"

[[bin]]
name = "pkill"
path = "src/main.rs"
7 changes: 7 additions & 0 deletions src/uu/pkill/pkill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pgrep

```
pkill [options] <pattern>
```

Kills processes based on name and other attributes.
1 change: 1 addition & 0 deletions src/uu/pkill/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uucore::bin!(uu_pkill);
Loading

0 comments on commit ab6e081

Please sign in to comment.