Skip to content

Commit 0058316

Browse files
authored
Merge pull request #9160 from matttbe/timeout-help
timeout: add missing extra help
2 parents 45fd3c9 + 8040e54 commit 0058316

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

src/uu/timeout/locales/en-US.ftl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ timeout-help-kill-after = also send a KILL signal if COMMAND is still running th
77
timeout-help-preserve-status = exit with the same status as COMMAND, even when the command times out
88
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
99
timeout-help-verbose = diagnose to stderr any signal sent upon timeout
10+
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
11+
timeout-help-command = a command to execute with optional arguments
12+
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.
13+
14+
Exit status:
15+
124 if COMMAND times out, and --preserve-status is not specified
16+
125 if the timeout command itself fails
17+
126 if COMMAND is found but cannot be invoked
18+
127 if COMMAND cannot be found
19+
137 if COMMAND (or timeout itself) is sent the KILL (9) signal (128+9)
20+
- the exit status of COMMAND otherwise
1021
1122
# Error messages
1223
timeout-error-invalid-signal = { $signal }: invalid signal

src/uu/timeout/locales/fr-FR.ftl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ timeout-help-kill-after = envoyer aussi un signal KILL si COMMANDE fonctionne en
77
timeout-help-preserve-status = sortir avec le même statut que COMMANDE, même quand la commande dépasse le délai
88
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
99
timeout-help-verbose = diagnostiquer vers stderr tout signal envoyé lors d'un dépassement de délai
10+
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é
11+
timeout-help-command = une commande à exécuter avec des arguments optionels
12+
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é.
13+
14+
Statut de sortie :
15+
124 si COMMANDE expire et que --preserve-status n'est pas spécifié
16+
125 si la commande timeout elle-même échoue
17+
126 si COMMANDE est trouvé mais ne peut être invoqué
18+
127 si COMMANDE est introuvable
19+
137 si COMMANDE (ou timeout lui-même) reçoit le signal KILL (9) (128+9)
20+
- sinon, le statut de sortie de COMMANDE
1021
1122
# Messages d'erreur
1223
timeout-error-invalid-signal = { $signal } : signal invalide

src/uu/timeout/src/timeout.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,21 @@ pub fn uu_app() -> Command {
159159
.help(translate!("timeout-help-verbose"))
160160
.action(ArgAction::SetTrue),
161161
)
162-
.arg(Arg::new(options::DURATION).required(true))
162+
.arg(
163+
Arg::new(options::DURATION)
164+
.required(true)
165+
.help(translate!("timeout-help-duration")),
166+
)
163167
.arg(
164168
Arg::new(options::COMMAND)
165169
.required(true)
166170
.action(ArgAction::Append)
171+
.help(translate!("timeout-help-command"))
167172
.value_hint(clap::ValueHint::CommandName),
168173
)
169174
.trailing_var_arg(true)
170175
.infer_long_args(true)
176+
.after_help(translate!("timeout-after-help"))
171177
}
172178

173179
/// Remove pre-existing SIGCHLD handlers that would make waiting for the child's exit code fail.

0 commit comments

Comments
 (0)