1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

stat: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 14:52:26 +01:00
parent ecf6f18ab3
commit eaaa16291e
2 changed files with 14 additions and 14 deletions

View file

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

View file

@ -953,7 +953,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let long_usage = get_long_usage(); let long_usage = get_long_usage();
let matches = uu_app() let matches = uu_app()
.usage(&usage[..]) .override_usage(&usage[..])
.after_help(&long_usage[..]) .after_help(&long_usage[..])
.get_matches_from(args); .get_matches_from(args);
@ -966,31 +966,31 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
} }
} }
pub fn uu_app() -> App<'static, 'static> { pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.arg( .arg(
Arg::with_name(options::DEREFERENCE) Arg::new(options::DEREFERENCE)
.short("L") .short('L')
.long(options::DEREFERENCE) .long(options::DEREFERENCE)
.help("follow links"), .help("follow links"),
) )
.arg( .arg(
Arg::with_name(options::FILE_SYSTEM) Arg::new(options::FILE_SYSTEM)
.short("f") .short('f')
.long(options::FILE_SYSTEM) .long(options::FILE_SYSTEM)
.help("display file system status instead of file status"), .help("display file system status instead of file status"),
) )
.arg( .arg(
Arg::with_name(options::TERSE) Arg::new(options::TERSE)
.short("t") .short('t')
.long(options::TERSE) .long(options::TERSE)
.help("print the information in terse form"), .help("print the information in terse form"),
) )
.arg( .arg(
Arg::with_name(options::FORMAT) Arg::new(options::FORMAT)
.short("c") .short('c')
.long(options::FORMAT) .long(options::FORMAT)
.help( .help(
"use the specified FORMAT instead of the default; "use the specified FORMAT instead of the default;
@ -999,7 +999,7 @@ pub fn uu_app() -> App<'static, 'static> {
.value_name("FORMAT"), .value_name("FORMAT"),
) )
.arg( .arg(
Arg::with_name(options::PRINTF) Arg::new(options::PRINTF)
.long(options::PRINTF) .long(options::PRINTF)
.value_name("FORMAT") .value_name("FORMAT")
.help( .help(
@ -1009,8 +1009,8 @@ pub fn uu_app() -> App<'static, 'static> {
), ),
) )
.arg( .arg(
Arg::with_name(ARG_FILES) Arg::new(ARG_FILES)
.multiple(true) .multiple_occurrences(true)
.takes_value(true) .takes_value(true)
.min_values(1), .min_values(1),
) )