mirror of
https://github.com/Noratrieb/captain.git
synced 2026-01-14 14:35:02 +01:00
stuff
This commit is contained in:
parent
f0ffa77500
commit
e82f2076b8
10 changed files with 329 additions and 5 deletions
|
|
@ -6,3 +6,4 @@ edition = "2021"
|
|||
[dependencies]
|
||||
clap = { version = "4.5.17", features = ["derive"] }
|
||||
eyre.workspace = true
|
||||
rustix = { version = "0.38.37", features = ["process"] }
|
||||
|
|
|
|||
26
coreutils/src/bin/user.rs
Normal file
26
coreutils/src/bin/user.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
use clap::Parser;
|
||||
use eyre::Result;
|
||||
|
||||
#[derive(Parser)]
|
||||
struct Cmd {
|
||||
#[command(subcommand)]
|
||||
cmd: Subcommand,
|
||||
}
|
||||
|
||||
#[derive(clap::Subcommand)]
|
||||
enum Subcommand {
|
||||
/// Get the current user's uid
|
||||
Id,
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args = Cmd::parse();
|
||||
|
||||
match args.cmd {
|
||||
Subcommand::Id => {
|
||||
println!("{}", rustix::process::getuid().as_raw());
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue