1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-06 16:07:47 +00:00

tac: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 15:01:07 +01:00
parent 57361292aa
commit 219498c2e8
2 changed files with 14 additions and 10 deletions

View file

@ -20,7 +20,7 @@ path = "src/tac.rs"
memchr = "2"
memmap2 = "0.5"
regex = "1"
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_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }

View file

@ -60,34 +60,38 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
tac(files, before, regex, separator)
}
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::BEFORE)
.short("b")
Arg::new(options::BEFORE)
.short('b')
.long(options::BEFORE)
.help("attach the separator before instead of after")
.takes_value(false),
)
.arg(
Arg::with_name(options::REGEX)
.short("r")
Arg::new(options::REGEX)
.short('r')
.long(options::REGEX)
.help("interpret the sequence as a regular expression")
.takes_value(false),
)
.arg(
Arg::with_name(options::SEPARATOR)
.short("s")
Arg::new(options::SEPARATOR)
.short('s')
.long(options::SEPARATOR)
.help("use STRING as the separator instead of newline")
.takes_value(true),
)
.arg(Arg::with_name(options::FILE).hidden(true).multiple(true))
.arg(
Arg::new(options::FILE)
.hide(true)
.multiple_occurrences(true),
)
}
/// Print lines of a buffer in reverse, with line separator given as a regex.