mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 15:22:38 +00:00
truncate: clap 3
This commit is contained in:
parent
6c37cdebce
commit
263357666f
2 changed files with 15 additions and 15 deletions
|
@ -15,7 +15,7 @@ edition = "2018"
|
|||
path = "src/truncate.rs"
|
||||
|
||||
[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_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
let long_usage = get_long_usage();
|
||||
|
||||
let matches = uu_app()
|
||||
.usage(&usage[..])
|
||||
.override_usage(&usage[..])
|
||||
.after_help(&long_usage[..])
|
||||
.get_matches_from(args);
|
||||
|
||||
|
@ -134,41 +134,41 @@ 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())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
Arg::with_name(options::IO_BLOCKS)
|
||||
.short("o")
|
||||
Arg::new(options::IO_BLOCKS)
|
||||
.short('o')
|
||||
.long(options::IO_BLOCKS)
|
||||
.help("treat SIZE as the number of I/O blocks of the file rather than bytes (NOT IMPLEMENTED)")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::NO_CREATE)
|
||||
.short("c")
|
||||
Arg::new(options::NO_CREATE)
|
||||
.short('c')
|
||||
.long(options::NO_CREATE)
|
||||
.help("do not create files that do not exist")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::REFERENCE)
|
||||
.short("r")
|
||||
Arg::new(options::REFERENCE)
|
||||
.short('r')
|
||||
.long(options::REFERENCE)
|
||||
.required_unless(options::SIZE)
|
||||
.required_unless_present(options::SIZE)
|
||||
.help("base the size of each file on the size of RFILE")
|
||||
.value_name("RFILE")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(options::SIZE)
|
||||
.short("s")
|
||||
Arg::new(options::SIZE)
|
||||
.short('s')
|
||||
.long(options::SIZE)
|
||||
.required_unless(options::REFERENCE)
|
||||
.required_unless_present(options::REFERENCE)
|
||||
.help("set or adjust the size of each file according to SIZE, which is in bytes unless --io-blocks is specified")
|
||||
.value_name("SIZE")
|
||||
)
|
||||
.arg(Arg::with_name(options::ARG_FILES)
|
||||
.arg(Arg::new(options::ARG_FILES)
|
||||
.value_name("FILE")
|
||||
.multiple(true)
|
||||
.multiple_occurrences(true)
|
||||
.takes_value(true)
|
||||
.required(true)
|
||||
.min_values(1))
|
||||
|
|
Loading…
Reference in a new issue