mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 21:47:46 +00:00
printenv: clap 3
This commit is contained in:
parent
c39a9b49d4
commit
8ba10936b0
2 changed files with 7 additions and 7 deletions
|
@ -15,7 +15,7 @@ edition = "2018"
|
||||||
path = "src/printenv.rs"
|
path = "src/printenv.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" }
|
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
|
||||||
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ fn usage() -> String {
|
||||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
let usage = usage();
|
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 variables: Vec<String> = matches
|
let variables: Vec<String> = matches
|
||||||
.values_of(ARG_VARIABLES)
|
.values_of(ARG_VARIABLES)
|
||||||
|
@ -61,19 +61,19 @@ 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(OPT_NULL)
|
Arg::new(OPT_NULL)
|
||||||
.short("0")
|
.short('0')
|
||||||
.long(OPT_NULL)
|
.long(OPT_NULL)
|
||||||
.help("end each output line with 0 byte rather than newline"),
|
.help("end each output line with 0 byte rather than newline"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(ARG_VARIABLES)
|
Arg::new(ARG_VARIABLES)
|
||||||
.multiple(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1),
|
.min_values(1),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue