bash-completion/completions/chkconfig

38 lines
928 B
Plaintext
Raw Normal View History

# chkconfig(8) completion -*- shell-script -*-
_chkconfig()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
--level=[1-6]|[1-6]|--list|--add|--del|--override)
2009-10-19 14:55:46 -07:00
_services
_xinetd_services
2009-10-19 14:55:46 -07:00
return 0
;;
--level)
COMPREPLY=( $( compgen -W '{1..6}' -- "$cur" ) )
2009-10-19 14:55:46 -07:00
return 0
;;
2009-10-04 10:42:50 -07:00
esac
2009-10-04 10:42:50 -07:00
$split && return 0
2009-10-04 10:42:50 -07:00
if [[ "$cur" == -* ]]; then
2011-11-09 08:06:59 -08:00
COMPREPLY=( $( compgen -W '--list --add --del --override --level' \
-- "$cur" ) )
2009-10-04 10:42:50 -07:00
else
if [[ $cword -eq 2 || $cword -eq 4 ]]; then
2011-11-09 08:06:59 -08:00
COMPREPLY=( $( compgen -W 'on off reset resetpriorities' \
-- "$cur" ) )
2009-10-04 10:42:50 -07:00
else
_services
_xinetd_services
2009-10-04 10:42:50 -07:00
fi
fi
} &&
complete -F _chkconfig chkconfig
2009-10-04 10:42:50 -07:00
# ex: ts=4 sw=4 et filetype=sh