mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-06 16:07:47 +00:00
tail: clap 3
This commit is contained in:
parent
219498c2e8
commit
9c9643807a
2 changed files with 20 additions and 20 deletions
|
@ -15,7 +15,7 @@ edition = "2018"
|
|||
path = "src/tail.rs"
|
||||
|
||||
[dependencies]
|
||||
clap = { version = "2.33", features = ["wrap_help"] }
|
||||
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
|
||||
libc = "0.2.42"
|
||||
uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["ringbuffer"] }
|
||||
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
||||
|
|
|
@ -271,14 +271,14 @@ fn arg_iterate<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
pub fn uu_app<'a>() -> App<'a> {
|
||||
App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.usage(USAGE)
|
||||
.override_usage(USAGE)
|
||||
.arg(
|
||||
Arg::with_name(options::BYTES)
|
||||
.short("c")
|
||||
Arg::new(options::BYTES)
|
||||
.short('c')
|
||||
.long(options::BYTES)
|
||||
.takes_value(true)
|
||||
.allow_hyphen_values(true)
|
||||
|
@ -286,14 +286,14 @@ pub fn uu_app() -> App<'static, 'static> {
|
|||
.help("Number of bytes to print"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::FOLLOW)
|
||||
.short("f")
|
||||
Arg::new(options::FOLLOW)
|
||||
.short('f')
|
||||
.long(options::FOLLOW)
|
||||
.help("Print the file as it grows"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::LINES)
|
||||
.short("n")
|
||||
Arg::new(options::LINES)
|
||||
.short('n')
|
||||
.long(options::LINES)
|
||||
.takes_value(true)
|
||||
.allow_hyphen_values(true)
|
||||
|
@ -301,42 +301,42 @@ pub fn uu_app() -> App<'static, 'static> {
|
|||
.help("Number of lines to print"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::PID)
|
||||
Arg::new(options::PID)
|
||||
.long(options::PID)
|
||||
.takes_value(true)
|
||||
.help("with -f, terminate after process ID, PID dies"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::verbosity::QUIET)
|
||||
.short("q")
|
||||
Arg::new(options::verbosity::QUIET)
|
||||
.short('q')
|
||||
.long(options::verbosity::QUIET)
|
||||
.visible_alias("silent")
|
||||
.overrides_with_all(&[options::verbosity::QUIET, options::verbosity::VERBOSE])
|
||||
.help("never output headers giving file names"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::SLEEP_INT)
|
||||
.short("s")
|
||||
Arg::new(options::SLEEP_INT)
|
||||
.short('s')
|
||||
.takes_value(true)
|
||||
.long(options::SLEEP_INT)
|
||||
.help("Number or seconds to sleep between polling the file when running with -f"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::verbosity::VERBOSE)
|
||||
.short("v")
|
||||
Arg::new(options::verbosity::VERBOSE)
|
||||
.short('v')
|
||||
.long(options::verbosity::VERBOSE)
|
||||
.overrides_with_all(&[options::verbosity::QUIET, options::verbosity::VERBOSE])
|
||||
.help("always output headers giving file names"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::ZERO_TERM)
|
||||
.short("z")
|
||||
Arg::new(options::ZERO_TERM)
|
||||
.short('z')
|
||||
.long(options::ZERO_TERM)
|
||||
.help("Line delimiter is NUL, not newline"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::ARG_FILES)
|
||||
.multiple(true)
|
||||
Arg::new(options::ARG_FILES)
|
||||
.multiple_occurrences(true)
|
||||
.takes_value(true)
|
||||
.min_values(1),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue