MCPcopy Create free account
hub / github.com/coreutils/coreutils / usage

Function usage

src/timeout.c:263–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void
264usage (int status)
265{
266 if (status != EXIT_SUCCESS)
267 emit_try_help ();
268 else
269 {
270 printf (_("\
271Usage: %s [OPTION]... DURATION COMMAND [ARG]...\n"), program_name);
272
273 fputs (_("\
274Start COMMAND, and kill it if still running after DURATION.\n\
275"), stdout);
276
277 emit_mandatory_arg_note ();
278
279 oputs (_("\
280 -f, --foreground\n\
281 when not running timeout directly from a shell prompt,\n\
282 allow COMMAND to read from the TTY and get TTY signals;\n\
283 in this mode, children of COMMAND will not be timed out\n\
284"));
285 oputs (_("\
286 -k, --kill-after=DURATION\n\
287 also send a KILL signal if COMMAND is still running\n\
288 this long after the initial signal was sent\n\
289"));
290 oputs (_("\
291 -p, --preserve-status\n\
292 exit with the same status as COMMAND,\n\
293 even when the command times out\n\
294"));
295 oputs (_("\
296 -s, --signal=SIGNAL\n\
297 specify the signal to be sent on timeout;\n\
298 SIGNAL may be a name like 'HUP' or a number;\n\
299 see 'kill -l' for a list of signals\n\
300"));
301 oputs (_("\
302 -v, --verbose\n\
303 diagnose to standard error any signal sent upon timeout\n\
304"));
305
306 oputs (HELP_OPTION_DESCRIPTION);
307 oputs (VERSION_OPTION_DESCRIPTION);
308
309 fputs (_("\n\
310DURATION is a floating point number with an optional suffix:\n\
311's' for seconds (the default), 'm' for minutes, 'h' for hours or \
312'd' for days.\nA duration of 0 disables the associated timeout.\n"), stdout);
313
314 fputs (_("\n\
315Upon timeout, send the TERM signal to COMMAND, if no other SIGNAL specified.\n\
316The TERM signal kills any process that does not block or catch that signal.\n\
317It may be necessary to use the KILL signal, since this signal can't be caught.\
318\n"), stdout);
319
320 fputs (_("\n\

Callers 2

parse_durationFunction · 0.70
mainFunction · 0.70

Calls 2

emit_mandatory_arg_noteFunction · 0.85
emit_ancillary_infoFunction · 0.85

Tested by

no test coverage detected