1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
# (C) 2016 magicant
# Completion script for the "watch" command.
# Supports procps-ng 3.3.10.
function completion/watch {
typeset OPTIONS ARGOPT PREFIX
OPTIONS=(
"b --beep; beep when the command returns a non-zero exit status"
"c --color; interpret ANSI color sequences"
"d:: --differences::; highlight the differences from previous output"
"e --errexit; stop when the command returns a non-zero exit status"
"g --chgexit; exit when command output differs from the previous"
"h --help; print help"
"n: --interval:; specify update interval in seconds"
"p --precise; keep update interval precise"
"t --no-title; turn off the header"
"v --version; print version info"
"x --exec; don't interpret operands as shell script"
) #<#
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(d|--differences)
complete -P "$PREFIX" permanent
;;
('')
command -f completion//getoperands
command -f completion//reexecute -e
;;
esac
}
# vim: set ft=sh ts=8 sts=8 sw=8 et:
|