1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-18 04:36:18 +00:00

dircolors: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 13:23:25 +01:00
parent 739217968f
commit 9bd1c3e967
2 changed files with 14 additions and 10 deletions

View file

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

View file

@ -73,7 +73,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage();
let matches = uu_app().usage(&usage[..]).get_matches_from(&args);
let matches = uu_app().override_usage(&usage[..]).get_matches_from(&args);
let files = matches
.values_of(options::FILE)
@ -160,35 +160,39 @@ 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())
.version(crate_version!())
.about(SUMMARY)
.after_help(LONG_HELP)
.arg(
Arg::with_name(options::BOURNE_SHELL)
Arg::new(options::BOURNE_SHELL)
.long("sh")
.short("b")
.short('b')
.visible_alias("bourne-shell")
.help("output Bourne shell code to set LS_COLORS")
.display_order(1),
)
.arg(
Arg::with_name(options::C_SHELL)
Arg::new(options::C_SHELL)
.long("csh")
.short("c")
.short('c')
.visible_alias("c-shell")
.help("output C shell code to set LS_COLORS")
.display_order(2),
)
.arg(
Arg::with_name(options::PRINT_DATABASE)
Arg::new(options::PRINT_DATABASE)
.long("print-database")
.short("p")
.short('p')
.help("print the byte counts")
.display_order(3),
)
.arg(Arg::with_name(options::FILE).hidden(true).multiple(true))
.arg(
Arg::new(options::FILE)
.hide(true)
.multiple_occurrences(true),
)
}
pub trait StrUtils {