1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

kill: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 13:50:05 +01:00
parent b61494337e
commit 83f39619d5
2 changed files with 13 additions and 13 deletions

View file

@ -15,7 +15,7 @@ edition = "2018"
path = "src/kill.rs" path = "src/kill.rs"
[dependencies] [dependencies]
clap = { version = "2.33", features = ["wrap_help"] } clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42" libc = "0.2.42"
uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["signals"] } uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["signals"] }
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }

View file

@ -43,7 +43,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let obs_signal = handle_obsolete(&mut args); let obs_signal = handle_obsolete(&mut args);
let usage = format!("{} [OPTIONS]... PID...", uucore::execution_phrase()); let usage = format!("{} [OPTIONS]... PID...", uucore::execution_phrase());
let matches = uu_app().usage(&usage[..]).get_matches_from(args); let matches = uu_app().override_usage(&usage[..]).get_matches_from(args);
let mode = if matches.is_present(options::TABLE) || matches.is_present(options::TABLE_OLD) { let mode = if matches.is_present(options::TABLE) || matches.is_present(options::TABLE_OLD) {
Mode::Table Mode::Table
@ -78,36 +78,36 @@ 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())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.arg( .arg(
Arg::with_name(options::LIST) Arg::new(options::LIST)
.short("l") .short('l')
.long(options::LIST) .long(options::LIST)
.help("Lists signals") .help("Lists signals")
.conflicts_with(options::TABLE) .conflicts_with(options::TABLE)
.conflicts_with(options::TABLE_OLD), .conflicts_with(options::TABLE_OLD),
) )
.arg( .arg(
Arg::with_name(options::TABLE) Arg::new(options::TABLE)
.short("t") .short('t')
.long(options::TABLE) .long(options::TABLE)
.help("Lists table of signals"), .help("Lists table of signals"),
) )
.arg(Arg::with_name(options::TABLE_OLD).short("L").hidden(true)) .arg(Arg::new(options::TABLE_OLD).short('L').hide(true))
.arg( .arg(
Arg::with_name(options::SIGNAL) Arg::new(options::SIGNAL)
.short("s") .short('s')
.long(options::SIGNAL) .long(options::SIGNAL)
.help("Sends given signal") .help("Sends given signal")
.takes_value(true), .takes_value(true),
) )
.arg( .arg(
Arg::with_name(options::PIDS_OR_SIGNALS) Arg::new(options::PIDS_OR_SIGNALS)
.hidden(true) .hide(true)
.multiple(true), .multiple_occurrences(true),
) )
} }