mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #3313 from jfinkels/timeout-kill-after-long-arg
timeout: support long form of --kill-after arg
This commit is contained in:
commit
9a0ef9a81f
2 changed files with 12 additions and 0 deletions
|
@ -134,7 +134,9 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::KILL_AFTER)
|
Arg::new(options::KILL_AFTER)
|
||||||
|
.long(options::KILL_AFTER)
|
||||||
.short('k')
|
.short('k')
|
||||||
|
.help("also send a KILL signal if COMMAND is still running this long after the initial signal was sent")
|
||||||
.takes_value(true))
|
.takes_value(true))
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::PRESERVE_STATUS)
|
Arg::new(options::PRESERVE_STATUS)
|
||||||
|
|
|
@ -105,3 +105,13 @@ fn test_invalid_signal() {
|
||||||
.fails()
|
.fails()
|
||||||
.usage_error("'invalid': invalid signal");
|
.usage_error("'invalid': invalid signal");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Test that the long form of the `--kill-after` argument is recognized.
|
||||||
|
#[test]
|
||||||
|
fn test_kill_after_long() {
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["--kill-after=1", "1", "sleep", "0"])
|
||||||
|
.succeeds()
|
||||||
|
.no_stdout()
|
||||||
|
.no_stderr();
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue