Merge pull request #9160 from matttbe/timeout-help
Some checks are pending
CICD / Style/deps (push) Waiting to run
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Test all features separately (push) Blocked by required conditions
CICD / Style/cargo-deny (push) Waiting to run
CICD / Documentation/warnings (push) Waiting to run
CICD / MinRustV (push) Waiting to run
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Separate Builds (push) Waiting to run
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
CICD / Build/SELinux-Stubs (Non-Linux) (push) Blocked by required conditions
CICD / Safe Traversal Security Check (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Benchmarks / Run benchmarks (CodSpeed) (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
Devcontainer / Verify devcontainer (push) Waiting to run
Check uudoc Documentation Generation / Verify uudoc generates correct documentation (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run

timeout: add missing extra help
This commit is contained in:
Daniel Hofstetter 2025-11-06 15:32:21 +01:00 committed by GitHub
commit 00583166cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 1 deletions

View file

@ -7,6 +7,17 @@ timeout-help-kill-after = also send a KILL signal if COMMAND is still running th
timeout-help-preserve-status = exit with the same status as COMMAND, even when the command times out
timeout-help-signal = specify the signal to be sent on timeout; SIGNAL may be a name like 'HUP' or a number; see 'kill -l' for a list of signals
timeout-help-verbose = diagnose to stderr any signal sent upon timeout
timeout-help-duration = a floating point number with an optional suffix: 's' for seconds (the default), 'm' for minutes, 'h' for hours or 'd' for days ; a duration of 0 disables the associated timeout
timeout-help-command = a command to execute with optional arguments
timeout-after-help = Upon timeout, send the TERM signal to COMMAND, if no other SIGNAL specified. The TERM signal kills any process that does not block or catch that signal. It may be necessary to use the KILL signal, since this signal can't be caught.
Exit status:
124 if COMMAND times out, and --preserve-status is not specified
125 if the timeout command itself fails
126 if COMMAND is found but cannot be invoked
127 if COMMAND cannot be found
137 if COMMAND (or timeout itself) is sent the KILL (9) signal (128+9)
- the exit status of COMMAND otherwise
# Error messages
timeout-error-invalid-signal = { $signal }: invalid signal

View file

@ -7,6 +7,17 @@ timeout-help-kill-after = envoyer aussi un signal KILL si COMMANDE fonctionne en
timeout-help-preserve-status = sortir avec le même statut que COMMANDE, même quand la commande dépasse le délai
timeout-help-signal = spécifier le signal à envoyer en cas de délai dépassé ; SIGNAL peut être un nom comme 'HUP' ou un nombre ; voir 'kill -l' pour une liste des signaux
timeout-help-verbose = diagnostiquer vers stderr tout signal envoyé lors d'un dépassement de délai
timeout-help-duration = un nombre à virgule flottante avec un suffixe facultatif : 's' pour les secondes (par défaut), 'm' pour les minutes, 'h' pour les heures ou 'd' pour les jours ; une durée de 0 désactive le délai d'expiration associé
timeout-help-command = une commande à exécuter avec des arguments optionels
timeout-after-help = À l'expiration du délai, le signal TERM est envoyé à COMMANDE, si aucun autre SIGNAL n'est spécifié. Le signal TERM tue tout processus qui ne bloque pas ou n'intercepte pas ce signal. Il peut être nécessaire d'utiliser le signal KILL, puisque ce signal ne peut pas être intercepté.
Statut de sortie :
124 si COMMANDE expire et que --preserve-status n'est pas spécifié
125 si la commande timeout elle-même échoue
126 si COMMANDE est trouvé mais ne peut être invoqué
127 si COMMANDE est introuvable
137 si COMMANDE (ou timeout lui-même) reçoit le signal KILL (9) (128+9)
- sinon, le statut de sortie de COMMANDE
# Messages d'erreur
timeout-error-invalid-signal = { $signal } : signal invalide

View file

@ -159,15 +159,21 @@ pub fn uu_app() -> Command {
.help(translate!("timeout-help-verbose"))
.action(ArgAction::SetTrue),
)
.arg(Arg::new(options::DURATION).required(true))
.arg(
Arg::new(options::DURATION)
.required(true)
.help(translate!("timeout-help-duration")),
)
.arg(
Arg::new(options::COMMAND)
.required(true)
.action(ArgAction::Append)
.help(translate!("timeout-help-command"))
.value_hint(clap::ValueHint::CommandName),
)
.trailing_var_arg(true)
.infer_long_args(true)
.after_help(translate!("timeout-after-help"))
}
/// Remove pre-existing SIGCHLD handlers that would make waiting for the child's exit code fail.