mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 13:07:46 +00:00
head: clap 3
This commit is contained in:
parent
6e34d8a53c
commit
9fc9fdb1f3
2 changed files with 14 additions and 14 deletions
|
@ -15,7 +15,7 @@ edition = "2018"
|
||||||
path = "src/head.rs"
|
path = "src/head.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "2.33", features = ["wrap_help"] }
|
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
|
||||||
memchr = "2"
|
memchr = "2"
|
||||||
uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["ringbuffer"] }
|
uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["ringbuffer"] }
|
||||||
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
||||||
|
|
|
@ -42,14 +42,14 @@ use lines::zlines;
|
||||||
use take::take_all_but;
|
use take::take_all_but;
|
||||||
use take::take_lines;
|
use take::take_lines;
|
||||||
|
|
||||||
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)
|
||||||
.usage(USAGE)
|
.override_usage(USAGE)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(options::BYTES_NAME)
|
Arg::new(options::BYTES_NAME)
|
||||||
.short("c")
|
.short('c')
|
||||||
.long("bytes")
|
.long("bytes")
|
||||||
.value_name("[-]NUM")
|
.value_name("[-]NUM")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
@ -64,8 +64,8 @@ pub fn uu_app() -> App<'static, 'static> {
|
||||||
.allow_hyphen_values(true),
|
.allow_hyphen_values(true),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(options::LINES_NAME)
|
Arg::new(options::LINES_NAME)
|
||||||
.short("n")
|
.short('n')
|
||||||
.long("lines")
|
.long("lines")
|
||||||
.value_name("[-]NUM")
|
.value_name("[-]NUM")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
@ -80,28 +80,28 @@ pub fn uu_app() -> App<'static, 'static> {
|
||||||
.allow_hyphen_values(true),
|
.allow_hyphen_values(true),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(options::QUIET_NAME)
|
Arg::new(options::QUIET_NAME)
|
||||||
.short("q")
|
.short('q')
|
||||||
.long("quiet")
|
.long("quiet")
|
||||||
.visible_alias("silent")
|
.visible_alias("silent")
|
||||||
.help("never print headers giving file names")
|
.help("never print headers giving file names")
|
||||||
.overrides_with_all(&[options::VERBOSE_NAME, options::QUIET_NAME]),
|
.overrides_with_all(&[options::VERBOSE_NAME, options::QUIET_NAME]),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(options::VERBOSE_NAME)
|
Arg::new(options::VERBOSE_NAME)
|
||||||
.short("v")
|
.short('v')
|
||||||
.long("verbose")
|
.long("verbose")
|
||||||
.help("always print headers giving file names")
|
.help("always print headers giving file names")
|
||||||
.overrides_with_all(&[options::QUIET_NAME, options::VERBOSE_NAME]),
|
.overrides_with_all(&[options::QUIET_NAME, options::VERBOSE_NAME]),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(options::ZERO_NAME)
|
Arg::new(options::ZERO_NAME)
|
||||||
.short("z")
|
.short('z')
|
||||||
.long("zero-terminated")
|
.long("zero-terminated")
|
||||||
.help("line delimiter is NUL, not newline")
|
.help("line delimiter is NUL, not newline")
|
||||||
.overrides_with(options::ZERO_NAME),
|
.overrides_with(options::ZERO_NAME),
|
||||||
)
|
)
|
||||||
.arg(Arg::with_name(options::FILES_NAME).multiple(true))
|
.arg(Arg::new(options::FILES_NAME).multiple_occurrences(true))
|
||||||
}
|
}
|
||||||
#[derive(PartialEq, Debug, Clone, Copy)]
|
#[derive(PartialEq, Debug, Clone, Copy)]
|
||||||
enum Modes {
|
enum Modes {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue