2009-06-05 08:35:24 +02:00
|
|
|
# chkconfig(8) completion
|
2009-10-01 20:54:51 +03:00
|
|
|
|
2011-04-05 00:35:51 +03:00
|
|
|
have chkconfig || return
|
|
|
|
|
2009-06-05 08:35:24 +02:00
|
|
|
_chkconfig()
|
|
|
|
{
|
2011-04-20 14:42:30 +03:00
|
|
|
local cur prev words cword
|
2011-04-25 00:09:50 +03:00
|
|
|
_init_completion -n = || return
|
2009-06-05 08:35:24 +02:00
|
|
|
|
2011-04-20 14:42:30 +03:00
|
|
|
local split=false
|
2009-10-04 19:42:50 +02:00
|
|
|
_split_longopt && split=true
|
2009-06-05 08:35:24 +02:00
|
|
|
|
2009-12-30 00:39:59 +01:00
|
|
|
case $prev in
|
2009-11-22 11:43:26 +01:00
|
|
|
--level=[1-6]|[1-6]|--list|--add|--del|--override)
|
2009-10-20 00:55:46 +03:00
|
|
|
_services
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--level)
|
2011-04-25 23:44:08 +03:00
|
|
|
COMPREPLY=( $( compgen -W '{1..6}' -- "$cur" ) )
|
2009-10-20 00:55:46 +03:00
|
|
|
return 0
|
|
|
|
;;
|
2009-10-04 19:42:50 +02:00
|
|
|
esac
|
2009-06-05 08:35:24 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
$split && return 0
|
2009-06-05 08:35:24 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
if [[ "$cur" == -* ]]; then
|
|
|
|
COMPREPLY=( $( compgen -W '--list --add --del --override --level' -- "$cur" ) )
|
|
|
|
else
|
2011-04-20 14:42:30 +03:00
|
|
|
if [[ $cword -eq 2 || $cword -eq 4 ]]; then
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=( $( compgen -W 'on off reset resetpriorities' -- "$cur" ) )
|
|
|
|
else
|
|
|
|
_services
|
|
|
|
fi
|
|
|
|
fi
|
2009-06-05 08:35:24 +02:00
|
|
|
} &&
|
|
|
|
complete -F _chkconfig chkconfig
|
2009-10-01 20:54:51 +03:00
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: shell-script
|
2009-10-04 19:42:50 +02:00
|
|
|
# sh-basic-offset: 4
|
2009-10-01 20:54:51 +03:00
|
|
|
# sh-indent-comment: t
|
2009-10-04 19:42:50 +02:00
|
|
|
# indent-tabs-mode: nil
|
2009-10-01 20:54:51 +03:00
|
|
|
# End:
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|