2011-11-01 22:14:45 +02:00
|
|
|
# chkconfig(8) completion -*- shell-script -*-
|
2009-10-01 20:54:51 +03:00
|
|
|
|
2009-06-05 08:35:24 +02:00
|
|
|
_chkconfig()
|
|
|
|
{
|
2011-05-01 22:18:40 +03:00
|
|
|
local cur prev words cword split
|
|
|
|
_init_completion -s || return
|
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
|
2011-11-09 18:14:23 +02:00
|
|
|
_xinetd_services
|
2009-10-20 00:55:46 +03:00
|
|
|
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
|
2011-11-09 18:06:59 +02:00
|
|
|
COMPREPLY=( $( compgen -W '--list --add --del --override --level' \
|
|
|
|
-- "$cur" ) )
|
2009-10-04 19:42:50 +02:00
|
|
|
else
|
2011-04-20 14:42:30 +03:00
|
|
|
if [[ $cword -eq 2 || $cword -eq 4 ]]; then
|
2011-11-09 18:06:59 +02:00
|
|
|
COMPREPLY=( $( compgen -W 'on off reset resetpriorities' \
|
|
|
|
-- "$cur" ) )
|
2009-10-04 19:42:50 +02:00
|
|
|
else
|
|
|
|
_services
|
2011-11-09 18:14:23 +02:00
|
|
|
_xinetd_services
|
2009-10-04 19:42:50 +02:00
|
|
|
fi
|
|
|
|
fi
|
2009-06-05 08:35:24 +02:00
|
|
|
} &&
|
|
|
|
complete -F _chkconfig chkconfig
|
2009-10-01 20:54:51 +03:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|