Skip to content

Implement namei command #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
314 changes: 275 additions & 39 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ feat_common_core = [
"renice",
"rev",
"setsid",
"namei",
]

[workspace.dependencies]
Expand All @@ -67,7 +68,7 @@ sysinfo = "0.34"
tempfile = "3.9.0"
textwrap = { version = "0.16.0", features = ["terminal_size"] }
thiserror = "2.0"
uucore = "0.0.30"
uucore = { version = "0.0.30", features = ["entries"] }
xattr = "1.3.1"

[dependencies]
Expand Down Expand Up @@ -98,6 +99,7 @@ mountpoint = { optional = true, version = "0.0.1", package = "uu_mountpoint", pa
renice = { optional = true, version = "0.0.1", package = "uu_renice", path = "src/uu/renice" }
rev = { optional = true, version = "0.0.1", package = "uu_rev", path = "src/uu/rev" }
setsid = { optional = true, version = "0.0.1", package = "uu_setsid", path ="src/uu/setsid" }
namei = { optional = true, version = "0.0.1", package = "uu_namei", path ="src/uu/namei" }

[dev-dependencies]
# dmesg test require fixed-boot-time feature turned on.
Expand Down
19 changes: 19 additions & 0 deletions src/uu/namei/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "uu_namei"
version = "0.0.1"
edition = "2021"

[dependencies]
uucore = { workspace = true }
clap = { workspace = true }
selinux = { version = "0.1", optional = true }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for this old version of the selinux crate? The current version is 0.5.1.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a typo. I have fixed it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also commit the updated Cargo.lock file?


[features]
selinux = ["dep:selinux"]

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

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

```
namei [options] <pathname>...
```

Follow a pathname until a terminal point is found.
1 change: 1 addition & 0 deletions src/uu/namei/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uucore::bin!(uu_namei);
Loading