doc: fix timeout --help for -p

* src/timeout.c (usage): Fix typo of period with comma.
* tests/timeout/timeout.sh: Only test a single option variant,
as tests/misc/usage_vs_getopt.sh suffices for basic option validation.
This commit is contained in:
Pádraig Brady committed 2024-11-01 12:49:44 +00:00
1 parent f4fbc1a9f9
commit 69aaec486f
2 files changed
+3 -7

No files matched your search

+1 -1
View File
@@ -275,7 +275,7 @@ Start COMMAND, and kill it if still running after DURATION.\n\
this long after the initial signal was sent\n\
"), stdout);
fputs (_("\
-p. --preserve-status\n\
-p, --preserve-status\n\
exit with the same status as COMMAND,\n\
even when the command times out\n\
"), stdout);
+2 -6
View File
@@ -37,9 +37,7 @@ returns_ 124 timeout .1 sleep 10 || fail=1
# exit status propagation even on timeout
# exit status should be 128+TERM
for opt in '-p' '--preserve-status'; do
returns_ 124 timeout $opt .1 sleep 10 && fail=1
done
returns_ 124 timeout --preserve-status .1 sleep 10 && fail=1
# kill delay. Note once the initial timeout triggers,
# the exit status will be 124 even if the command
@@ -47,9 +45,7 @@ done
# exit status should be 128+KILL
returns_ 124 timeout -s0 -k1 .1 sleep 10 && fail=1
# Ensure a consistent exit status with --foreground
for opt in '-f' '--foreground'; do
returns_ 124 timeout $opt -s0 -k1 .1 sleep 10 && fail=1
done
returns_ 124 timeout --foreground -s0 -k1 .1 sleep 10 && fail=1
# Ensure 'timeout' is immune to parent's SIGCHLD handler
# Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh.