]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: fix timeout --help for -p
authorPádraig Brady <P@draigBrady.com>
Fri, 1 Nov 2024 12:42:41 +0000 (12:42 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 1 Nov 2024 12:49:44 +0000 (12:49 +0000)
* 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.

src/timeout.c
tests/timeout/timeout.sh

index 0f1afb119120fff4c9331813ece10a7d2f4b2cb8..5600ce42957dcf117785f6a361ef72ac9c2df352 100644 (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);
index 31af249cda87305097fd9c656f70e1d42a52a746..882d1300d5cc22e0a55d70fb8f99c307313c0cc0 100755 (executable)
@@ -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.