Skip to content

Commit

Permalink
Merge pull request #3313 from jfinkels/timeout-kill-after-long-arg
Browse files Browse the repository at this point in the history
timeout: support long form of --kill-after arg
  • Loading branch information
sylvestre authored Mar 27, 2022
2 parents 2399982 + c43ef8b commit 9a0ef9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/uu/timeout/src/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ pub fn uu_app<'a>() -> Command<'a> {
)
.arg(
Arg::new(options::KILL_AFTER)
.long(options::KILL_AFTER)
.short('k')
.help("also send a KILL signal if COMMAND is still running this long after the initial signal was sent")
.takes_value(true))
.arg(
Arg::new(options::PRESERVE_STATUS)
Expand Down
10 changes: 10 additions & 0 deletions tests/by-util/test_timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,13 @@ fn test_invalid_signal() {
.fails()
.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();
}

0 comments on commit 9a0ef9a

Please sign in to comment.