1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-29 15:40:56 +01:00
zsh/Completion/Unix/Command/_timeout
2025-09-25 09:28:35 +02:00

19 lines
875 B
Text

#compdef timeout gtimeout
local args
[[ $service = g* || $OSTYPE != *(netbsd|openbsd)* ]] && args=(
'(-v --verbose)'{-v,--verbose}'[indicate when signal is sent upon timeout]'
)
[[ $service = g* || $OSTYPE != *(#i)(dragonfly|(free|net|open)bsd)* ]] && args+=(
'(- *)--help[display usage information]'
'(- *)--version[display version information]'
)
_arguments -S -A "-" $args \
'--preserve-status[always exit with the same status as command even if it times out]' \
"--foreground[don't propagate timeout to the command children]" \
'(-s --signal)'{-s,--signal}'[specify the signal to send on timeout]:signal:_signals' \
'(-k --kill-after)'{-k,--kill-after}'[followup first signal with SIGKILL if command persists after specified time]:time' \
'1: :_numbers -f -u seconds duration :s:seconds m:minutes h:hours d:days' \
'*:::command: _normal -p $service'