diff --git a/pkg/bin/shitbox b/pkg/bin/shitbox new file mode 100755 index 0000000..9147543 Binary files /dev/null and b/pkg/bin/shitbox differ diff --git a/pkg/usr/share/man/man1/base32.1 b/pkg/usr/share/man/man1/base32.1 new file mode 100644 index 0000000..ba0806a --- /dev/null +++ b/pkg/usr/share/man/man1/base32.1 @@ -0,0 +1,38 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH base32 1 "base32 0.1.0" +.SH NAME +base32 \- Base32 encode/decode data and print to standard output +.SH SYNOPSIS +\fBbase32\fR [\fB\-d\fR|\fB\-\-decode\fR] [\fB\-i\fR|\fB\-\-ignore\-space\fR] [\fB\-w\fR|\fB\-\-wrap\fR] [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fIINPUT\fR] +.SH DESCRIPTION +Base32 encode/decode data and print to standard output +.SH OPTIONS +.TP +\fB\-d\fR, \fB\-\-decode\fR +Decode rather than encode +.TP +\fB\-i\fR, \fB\-\-ignore\-space\fR +Ignore whitespace when decoding +.TP +\fB\-w\fR, \fB\-\-wrap\fR [default: 76] +Wrap encoded lines after n characters +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Display a header naming each file +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Do not display header, even with multiple files +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.TP +[\fIINPUT\fR] +The input file to use +.SH VERSION +v0.1.0 +.SH AUTHORS +The JeanG3nie diff --git a/pkg/usr/share/man/man1/dirname.1 b/pkg/usr/share/man/man1/dirname.1 new file mode 100644 index 0000000..192391d --- /dev/null +++ b/pkg/usr/share/man/man1/dirname.1 @@ -0,0 +1,24 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH dirname 1 "dirname 0.1.0" +.SH NAME +dirname \- strip last component from file name +.SH SYNOPSIS +\fBdirname\fR [\fB\-z\fR|\fB\-\-zero\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] <\fIname\fR> +.SH DESCRIPTION +strip last component from file name +.SH OPTIONS +.TP +\fB\-z\fR, \fB\-\-zero\fR +end each output line with NUL, not newline +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.TP +<\fIname\fR> + +.SH VERSION +v0.1.0 diff --git a/pkg/usr/share/man/man1/echo.1 b/pkg/usr/share/man/man1/echo.1 new file mode 100644 index 0000000..a431e50 --- /dev/null +++ b/pkg/usr/share/man/man1/echo.1 @@ -0,0 +1,26 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH echo 1 "echo 0.1.0" +.SH NAME +echo \- Display a line of text +.SH SYNOPSIS +\fBecho\fR [\fB\-n \fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fISTRING\fR] +.SH DESCRIPTION +Echo the STRING(s) to standard output +.SH OPTIONS +.TP +\fB\-n\fR +Do not output a trailing newline +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information (use `\-h` for a summary) +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.TP +[\fISTRING\fR] + +.SH VERSION +v0.1.0 +.SH AUTHORS +Nathan Fisher diff --git a/pkg/usr/share/man/man1/false.1 b/pkg/usr/share/man/man1/false.1 new file mode 100644 index 0000000..241f952 --- /dev/null +++ b/pkg/usr/share/man/man1/false.1 @@ -0,0 +1,20 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH false 1 "false 0.1.0" +.SH NAME +false \- Does nothing unsuccessfully +.SH SYNOPSIS +\fBfalse\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] +.SH DESCRIPTION +Exit with a status code indicating failure +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information (use `\-h` for a summary) +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.SH VERSION +v0.1.0 +.SH AUTHORS +Nathan Fisher diff --git a/pkg/usr/share/man/man1/head.1 b/pkg/usr/share/man/man1/head.1 new file mode 100644 index 0000000..b2b9bd3 --- /dev/null +++ b/pkg/usr/share/man/man1/head.1 @@ -0,0 +1,38 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH head 1 "head 0.1.0" +.SH NAME +head \- Display first lines of a file +.SH SYNOPSIS +\fBhead\fR [\fB\-c\fR|\fB\-\-bytes\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-n\fR|\fB\-\-lines\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fIFILES\fR] +.SH DESCRIPTION +Print the first 10 lines of each FILE to standard output. +With more than one FILE, precede each with a header giving the file name. +.PP +With no FILE, or when FILE is \-, read standard input. +.SH OPTIONS +.TP +\fB\-c\fR, \fB\-\-bytes\fR +Count bytes instead of lines +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Disable printing a header. Overrides \-c +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Each file is preceded by a header consisting of the string "==> XXX <==" where "XXX" is the name of the file. +.TP +\fB\-n\fR, \fB\-\-lines\fR +Count n number of lines (or bytes if \-c is specified). +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information (use `\-h` for a summary) +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.TP +[\fIFILES\fR] +The input file to use +.SH VERSION +v0.1.0 +.SH AUTHORS +Nathan Fisher diff --git a/pkg/usr/share/man/man1/hostname.1 b/pkg/usr/share/man/man1/hostname.1 new file mode 100644 index 0000000..976d14d --- /dev/null +++ b/pkg/usr/share/man/man1/hostname.1 @@ -0,0 +1,26 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH hostname 1 "hostname 0.1.0" +.SH NAME +hostname \- Prints the name of the current host. The super\-user can set the host name by supplying an argument. +.SH SYNOPSIS +\fBhostname\fR [\fB\-s\fR|\fB\-\-strip\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fINAME\fR] +.SH DESCRIPTION +Prints the name of the current host. The super\-user can set the host name by supplying an argument. +.SH OPTIONS +.TP +\fB\-s\fR, \fB\-\-strip\fR +Removes any domain information from the printed name. +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.TP +[\fINAME\fR] +name to set +.SH VERSION +v0.1.0 +.SH AUTHORS +The JeanG3nie diff --git a/pkg/usr/share/man/man1/nologin.1 b/pkg/usr/share/man/man1/nologin.1 new file mode 100644 index 0000000..781b274 --- /dev/null +++ b/pkg/usr/share/man/man1/nologin.1 @@ -0,0 +1,20 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH nologin 1 "nologin 0.1.0" +.SH NAME +nologin \- Denies a user account login ability +.SH SYNOPSIS +\fBnologin\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] +.SH DESCRIPTION +Denies a user account login ability +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.SH VERSION +v0.1.0 +.SH AUTHORS +Nathan Fisher diff --git a/pkg/usr/share/man/man1/shitbox-bootstrap.1 b/pkg/usr/share/man/man1/shitbox-bootstrap.1 new file mode 100644 index 0000000..b4d61d8 --- /dev/null +++ b/pkg/usr/share/man/man1/shitbox-bootstrap.1 @@ -0,0 +1,46 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH bootstrap 1 "bootstrap 0.1.0" +.SH NAME +bootstrap \- Install shitbox into the filesystem +.SH SYNOPSIS +\fBbootstrap\fR [\fB\-p\fR|\fB\-\-prefix\fR] [\fB\-u\fR|\fB\-\-usr\fR] [\fB\-s\fR|\fB\-\-soft\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fIsubcommands\fR] +.SH DESCRIPTION +Install symlinks, manpages and shell completions +.SH OPTIONS +.TP +\fB\-p\fR, \fB\-\-prefix\fR [default: /] +The directory path under which to install +.TP +\fB\-u\fR, \fB\-\-usr\fR +Split the installation so that some applets go into /bin | /sbin +while others are placed into /usr/bin | /usr/sbin +.TP +\fB\-s\fR, \fB\-\-soft\fR +Install soft links instead of hardlinks +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information (use `\-h` for a summary) +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.SH SUBCOMMANDS +.TP +bootstrap\-all(1) +Install everything +.TP +bootstrap\-links(1) +Install links for each applet +.TP +bootstrap\-manpages(1) +Install Unix man pages +.TP +bootstrap\-completions(1) +Install shell completions +.TP +bootstrap\-help(1) +Print this message or the help of the given subcommand(s) +.SH VERSION +v0.1.0 +.SH AUTHORS +Nathan Fisher diff --git a/pkg/usr/share/man/man1/shitbox.1 b/pkg/usr/share/man/man1/shitbox.1 new file mode 100644 index 0000000..ad6de53 --- /dev/null +++ b/pkg/usr/share/man/man1/shitbox.1 @@ -0,0 +1,52 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH shitbox 1 "shitbox 0.1.0" +.SH NAME +shitbox \- The Harbor Freight multitool of embedded Linux +.SH SYNOPSIS +\fBshitbox\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fIsubcommands\fR] +.SH DESCRIPTION +The Harbor Freight multitool of embedded Linux +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.SH SUBCOMMANDS +.TP +shitbox\-base32(1) +Base32 encode/decode data and print to standard output +.TP +shitbox\-bootstrap(1) +Install shitbox into the filesystem +.TP +shitbox\-echo(1) +Display a line of text +.TP +shitbox\-dirname(1) +strip last component from file name +.TP +shitbox\-false(1) +Does nothing unsuccessfully +.TP +shitbox\-head(1) +Display first lines of a file +.TP +shitbox\-nologin(1) +Denies a user account login ability +.TP +shitbox\-hostname(1) +Prints the name of the current host. The super\-user can set the host name by supplying an argument. +.TP +shitbox\-sleep(1) +Suspend execution for an interval of time +.TP +shitbox\-true(1) +Does nothing successfully +.TP +shitbox\-help(1) +Print this message or the help of the given subcommand(s) +.SH VERSION +v0.1.0 diff --git a/pkg/usr/share/man/man1/sleep.1 b/pkg/usr/share/man/man1/sleep.1 new file mode 100644 index 0000000..22881fe --- /dev/null +++ b/pkg/usr/share/man/man1/sleep.1 @@ -0,0 +1,25 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH sleep 1 "sleep 0.1.0" +.SH NAME +sleep \- Suspend execution for an interval of time +.SH SYNOPSIS +\fBsleep\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] <\fIseconds\fR> +.SH DESCRIPTION +The sleep utility suspends execution for a minimum of the specified number of seconds. +This number must be positive and may contain a decimal fraction. +sleep is commonly used to schedule the execution of other commands +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information (use `\-h` for a summary) +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.TP +<\fIseconds\fR> +The number of seconds to sleep +.SH VERSION +v0.1.0 +.SH AUTHORS + diff --git a/pkg/usr/share/man/man1/true.1 b/pkg/usr/share/man/man1/true.1 new file mode 100644 index 0000000..601375b --- /dev/null +++ b/pkg/usr/share/man/man1/true.1 @@ -0,0 +1,20 @@ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.TH true 1 "true 0.1.0" +.SH NAME +true \- Does nothing successfully +.SH SYNOPSIS +\fBtrue\fR [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] +.SH DESCRIPTION +Exit with a status code indicating success +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Print help information (use `\-h` for a summary) +.TP +\fB\-V\fR, \fB\-\-version\fR +Print version information +.SH VERSION +v0.1.0 +.SH AUTHORS +Nathan Fisher diff --git a/src/cmd/base32/mod.rs b/src/cmd/base32/mod.rs index 6692ef7..33605a6 100644 --- a/src/cmd/base32/mod.rs +++ b/src/cmd/base32/mod.rs @@ -1,5 +1,5 @@ use super::Cmd; -use clap::{Arg, ArgAction, Command}; +use clap::{Arg, ArgAction, Command, value_parser}; use data_encoding::BASE32; use std::{ fs, @@ -25,7 +25,6 @@ impl Cmd for Base32 { fn cli(&self) -> clap::Command { Command::new("base32") - .version(env!("CARGO_PKG_VERSION")) .author("The JeanG3nie ") .about("Base32 encode/decode data and print to standard output") .args([ @@ -46,6 +45,7 @@ impl Cmd for Base32 { .help("Wrap encoded lines after n characters") .short('w') .long("wrap") + .value_parser(value_parser!(usize)) .default_value("76"), Arg::new("VERBOSE") .help("Display a header naming each file") diff --git a/src/cmd/dirname/mod.rs b/src/cmd/dirname/mod.rs new file mode 100644 index 0000000..4478b2b --- /dev/null +++ b/src/cmd/dirname/mod.rs @@ -0,0 +1,63 @@ +use super::Cmd; +use clap::{Arg, ArgAction, Command}; +use std::path::Path; + +#[derive(Debug)] +pub struct Dirname { + name: &'static str, + path: Option, +} + +pub const DIRNAME: Dirname = Dirname { + name: "dirname", + path: Some(crate::Path::UsrBin), +}; + +impl Cmd for Dirname { + fn name(&self) -> &str { + self.name + } + + fn cli(&self) -> clap::Command { + Command::new("dirname") + .about("strip last component from file name") + .args([ + Arg::new("zero") + .short('z') + .long("zero") + .help("end each output line with NUL, not newline") + .action(ArgAction::SetTrue), + Arg::new("name").num_args(1..).required(true), + ]) + } + + fn run(&self, matches: Option<&clap::ArgMatches>) -> Result<(), Box> { + if let Some(matches) = matches { + if let Some(names) = matches.get_many::("name") { + names.for_each(|name| { + let path = match Path::new(name).parent() { + Some(p) => p, + None => Path::new("."), + }; + let path = path.to_string_lossy(); + let path = if path.is_empty() { + String::from(".") + } else { + path.to_string() + }; + if matches.get_flag("zero") { + print!("{}\0", path); + } else { + println!("{}", path); + } + }); + } + } + Ok(()) + } + + fn path(&self) -> Option { + self.path + } +} + diff --git a/src/cmd/echo/mod.rs b/src/cmd/echo/mod.rs index 3e848ed..a12430c 100644 --- a/src/cmd/echo/mod.rs +++ b/src/cmd/echo/mod.rs @@ -23,7 +23,6 @@ impl Cmd for Echo { Command::new(self.name) .about("Display a line of text") .long_about("Echo the STRING(s) to standard output") - .version(env!("CARGO_PKG_VERSION")) .author("Nathan Fisher") .args([ Arg::new("inline") diff --git a/src/cmd/false/mod.rs b/src/cmd/false/mod.rs index 510e120..7a5a1c3 100644 --- a/src/cmd/false/mod.rs +++ b/src/cmd/false/mod.rs @@ -24,7 +24,6 @@ impl Cmd for False { .about("Does nothing unsuccessfully") .long_about("Exit with a status code indicating failure") .author("Nathan Fisher") - .version(env!("CARGO_PKG_VERSION")) } fn run(&self, _matches: Option<&clap::ArgMatches>) -> Result<(), Box> { diff --git a/src/cmd/head/mod.rs b/src/cmd/head/mod.rs index 0c7e6e3..ff1e41f 100644 --- a/src/cmd/head/mod.rs +++ b/src/cmd/head/mod.rs @@ -2,10 +2,11 @@ use super::Cmd; use crate::Path; use clap::{value_parser, Arg, ArgAction, ArgMatches, Command}; use std::{ + env, error::Error, fs, io::{self, stdin, Read}, - process, env, + process, }; #[derive(Debug)] @@ -26,7 +27,6 @@ impl Cmd for Head { fn cli(&self) -> Command { Command::new(self.name) - .version(env!("CARGO_PKG_VERSION")) .author("Nathan Fisher") .about("Display first lines of a file") .long_about( @@ -85,12 +85,7 @@ impl Cmd for Head { vec!["-"] }; for file in &files { - head( - &file, - lines, - false, - false, - ); + head(&file, lines, false, false); } return Ok(()); } @@ -113,12 +108,7 @@ impl Cmd for Head { if index == 1 && header { println!(); } - head( - &file, - lines, - header, - matches.get_flag("BYTES"), - ); + head(&file, lines, header, matches.get_flag("BYTES")); } Ok(()) } diff --git a/src/cmd/hostname/mod.rs b/src/cmd/hostname/mod.rs index f38301c..82bfab3 100644 --- a/src/cmd/hostname/mod.rs +++ b/src/cmd/hostname/mod.rs @@ -21,7 +21,6 @@ impl Cmd for Hostname { fn cli(&self) -> clap::Command { Command::new(self.name) - .version(env!("CARGO_PKG_VERSION")) .author("The JeanG3nie ") .about("Prints the name of the current host. The super-user can set the host name by supplying an argument.") .args([ diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index 51be188..4d9c130 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -16,6 +16,7 @@ mod chmod; mod cp; mod date; mod dd; +pub mod dirname; pub mod echo; pub mod r#false; mod getty; @@ -38,6 +39,7 @@ pub use { self::hostname::{Hostname, HOSTNAME}, base32::{Base32, BASE_32}, bootstrap::{Bootstrap, BOOTSTRAP}, + dirname::{Dirname, DIRNAME}, echo::{Echo, ECHO}, head::{Head, HEAD}, nologin::{Nologin, NOLOGIN}, diff --git a/src/cmd/nologin/mod.rs b/src/cmd/nologin/mod.rs index a3ece9e..dc2d73d 100644 --- a/src/cmd/nologin/mod.rs +++ b/src/cmd/nologin/mod.rs @@ -20,7 +20,6 @@ impl Cmd for Nologin { fn cli(&self) -> clap::Command { Command::new(self.name) - .version(env!("CARGO_PKG_VERSION")) .author("Nathan Fisher") .about("Denies a user account login ability") } diff --git a/src/cmd/shitbox/mod.rs b/src/cmd/shitbox/mod.rs index 640626e..ebf689d 100644 --- a/src/cmd/shitbox/mod.rs +++ b/src/cmd/shitbox/mod.rs @@ -1,4 +1,4 @@ -use super::{Cmd, BOOTSTRAP, ECHO, FALSE, HEAD, HOSTNAME, NOLOGIN, SLEEP, TRUE, BASE_32}; +use super::{Cmd, BASE_32, BOOTSTRAP, DIRNAME, ECHO, FALSE, HEAD, HOSTNAME, NOLOGIN, SLEEP, TRUE}; use clap::Command; use std::{ error::Error, @@ -25,10 +25,14 @@ impl Cmd for Shitbox { Command::new(self.name) .about("The Harbor Freight multitool of embedded Linux") .version(env!("CARGO_PKG_VERSION")) + .propagate_version(true) .arg_required_else_help(true) + .subcommand_value_name("APPLET") + .subcommand_help_heading("APPLETS") .subcommands([ BASE_32.cli(), BOOTSTRAP.cli(), + DIRNAME.cli(), ECHO.cli(), FALSE.cli(), HEAD.cli(), @@ -48,6 +52,7 @@ impl Cmd for Shitbox { match matches.subcommand() { Some(("base32", matches)) => BASE_32.run(Some(matches))?, Some(("bootstrap", matches)) => BOOTSTRAP.run(Some(matches))?, + Some(("dirname", matches)) => DIRNAME.run(Some(matches))?, Some(("echo", _matches)) => ECHO.run(None)?, Some(("false", _matches)) => FALSE.run(None)?, Some(("head", matches)) => HEAD.run(Some(matches))?, diff --git a/src/cmd/sleep/mod.rs b/src/cmd/sleep/mod.rs index 799a4d1..73603d0 100644 --- a/src/cmd/sleep/mod.rs +++ b/src/cmd/sleep/mod.rs @@ -27,7 +27,6 @@ impl Cmd for Sleep { This number must be positive and may contain a decimal fraction.\n\ sleep is commonly used to schedule the execution of other commands" ) - .version(env!("CARGO_PKG_VERSION")) .author(env!("CARGO_PKG_AUTHORS")) .arg( Arg::new("seconds") diff --git a/src/cmd/true/mod.rs b/src/cmd/true/mod.rs index 18c36fe..56b2d38 100644 --- a/src/cmd/true/mod.rs +++ b/src/cmd/true/mod.rs @@ -23,7 +23,6 @@ impl Cmd for True { Command::new(self.name) .about("Does nothing successfully") .long_about("Exit with a status code indicating success") - .version(env!("CARGO_PKG_VERSION")) .author("Nathan Fisher") } diff --git a/src/lib.rs b/src/lib.rs index 882d945..83920bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,9 @@ use std::{env, error::Error, path::PathBuf, string::ToString}; pub mod cmd; -use cmd::{Cmd, Commands, BOOTSTRAP, ECHO, FALSE, HEAD, HOSTNAME, NOLOGIN, SHITBOX, SLEEP, TRUE, BASE_32}; +use cmd::{ + Cmd, Commands, BASE_32, BOOTSTRAP, DIRNAME, ECHO, FALSE, HEAD, HOSTNAME, NOLOGIN, SHITBOX, SLEEP, TRUE, +}; #[derive(Debug, Clone, Copy)] pub enum Path { @@ -37,7 +39,8 @@ pub fn run() -> Result<(), Box> { cmd::COMMANDS .set(Commands { items: vec![ - &BASE_32, &BOOTSTRAP, &ECHO, &FALSE, &HEAD, &HOSTNAME, &NOLOGIN, &TRUE, &SLEEP, &SHITBOX, + &BASE_32, &BOOTSTRAP, &DIRNAME, &ECHO, &FALSE, &HEAD, &HOSTNAME, &NOLOGIN, &TRUE, &SLEEP, + &SHITBOX, ], }) .expect("Cannot register commands"); @@ -45,6 +48,7 @@ pub fn run() -> Result<(), Box> { if let Some(progname) = progname() { match progname.as_str() { "base32" => BASE_32.run(Some(&BASE_32.cli().get_matches()))?, + "dirname" => DIRNAME.run(Some(&DIRNAME.cli().get_matches()))?, "echo" => ECHO.run(None)?, "false" => FALSE.run(None)?, "head" => {