mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
seq: clap 3
This commit is contained in:
parent
ec42e824f0
commit
41513a8ba6
2 changed files with 13 additions and 13 deletions
|
@ -17,7 +17,7 @@ path = "src/seq.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bigdecimal = "0.3"
|
bigdecimal = "0.3"
|
||||||
clap = { version = "2.33", features = ["wrap_help"] }
|
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
|
||||||
num-bigint = "0.4.0"
|
num-bigint = "0.4.0"
|
||||||
num-traits = "0.2.14"
|
num-traits = "0.2.14"
|
||||||
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
|
||||||
|
|
|
@ -58,7 +58,7 @@ type RangeFloat = (ExtendedBigDecimal, ExtendedBigDecimal, ExtendedBigDecimal);
|
||||||
#[uucore_procs::gen_uumain]
|
#[uucore_procs::gen_uumain]
|
||||||
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 numbers = matches.values_of(ARG_NUMBERS).unwrap().collect::<Vec<_>>();
|
let numbers = matches.values_of(ARG_NUMBERS).unwrap().collect::<Vec<_>>();
|
||||||
|
|
||||||
|
@ -137,38 +137,38 @@ 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())
|
||||||
.setting(AppSettings::AllowLeadingHyphen)
|
.setting(AppSettings::TrailingVarArg)
|
||||||
|
.setting(AppSettings::AllowHyphenValues)
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.about(ABOUT)
|
.about(ABOUT)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(OPT_SEPARATOR)
|
Arg::new(OPT_SEPARATOR)
|
||||||
.short("s")
|
.short('s')
|
||||||
.long("separator")
|
.long("separator")
|
||||||
.help("Separator character (defaults to \\n)")
|
.help("Separator character (defaults to \\n)")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.number_of_values(1),
|
.number_of_values(1),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(OPT_TERMINATOR)
|
Arg::new(OPT_TERMINATOR)
|
||||||
.short("t")
|
.short('t')
|
||||||
.long("terminator")
|
.long("terminator")
|
||||||
.help("Terminator character (defaults to \\n)")
|
.help("Terminator character (defaults to \\n)")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.number_of_values(1),
|
.number_of_values(1),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(OPT_WIDTHS)
|
Arg::new(OPT_WIDTHS)
|
||||||
.short("w")
|
.short('w')
|
||||||
.long("widths")
|
.long("widths")
|
||||||
.help("Equalize widths of all numbers by padding with zeros"),
|
.help("Equalize widths of all numbers by padding with zeros"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(ARG_NUMBERS)
|
Arg::new(ARG_NUMBERS)
|
||||||
.multiple(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.allow_hyphen_values(true)
|
|
||||||
.max_values(3)
|
.max_values(3)
|
||||||
.required(true),
|
.required(true),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue