1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

mkfifo: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 14:02:38 +01:00
parent 0e021e956a
commit c8eddad610
2 changed files with 13 additions and 9 deletions

View file

@ -15,7 +15,7 @@ edition = "2018"
path = "src/mkfifo.rs"
[dependencies]
clap = { version = "2.33", features = ["wrap_help"] }
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42"
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }

View file

@ -69,27 +69,27 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Ok(())
}
pub fn uu_app() -> App<'static, 'static> {
pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name())
.name(NAME)
.version(crate_version!())
.usage(USAGE)
.override_usage(USAGE)
.about(SUMMARY)
.arg(
Arg::with_name(options::MODE)
.short("m")
Arg::new(options::MODE)
.short('m')
.long(options::MODE)
.help("file permissions for the fifo")
.default_value("0666")
.value_name("0666"),
)
.arg(
Arg::with_name(options::SE_LINUX_SECURITY_CONTEXT)
.short(options::SE_LINUX_SECURITY_CONTEXT)
Arg::new(options::SE_LINUX_SECURITY_CONTEXT)
.short('Z')
.help("set the SELinux security context to default type"),
)
.arg(
Arg::with_name(options::CONTEXT)
Arg::new(options::CONTEXT)
.long(options::CONTEXT)
.value_name("CTX")
.help(
@ -97,5 +97,9 @@ pub fn uu_app() -> App<'static, 'static> {
or SMACK security context to CTX",
),
)
.arg(Arg::with_name(options::FIFO).hidden(true).multiple(true))
.arg(
Arg::new(options::FIFO)
.hide(true)
.multiple_occurrences(true),
)
}