2011-11-01 13:14:45 -07:00
|
|
|
# chkconfig(8) completion -*- shell-script -*-
|
2009-10-01 10:54:51 -07:00
|
|
|
|
2009-06-04 23:35:24 -07:00
|
|
|
_chkconfig()
|
|
|
|
{
|
2011-05-01 12:18:40 -07:00
|
|
|
local cur prev words cword split
|
|
|
|
_init_completion -s || return
|
2009-06-04 23:35:24 -07:00
|
|
|
|
2009-12-29 15:39:59 -08:00
|
|
|
case $prev in
|
2009-11-22 02:43:26 -08:00
|
|
|
--level=[1-6]|[1-6]|--list|--add|--del|--override)
|
2009-10-19 14:55:46 -07:00
|
|
|
_services
|
2011-11-09 08:14:23 -08:00
|
|
|
_xinetd_services
|
2009-10-19 14:55:46 -07:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
--level)
|
2011-04-25 13:44:08 -07:00
|
|
|
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-06-04 23:35:24 -07:00
|
|
|
|
2009-10-04 10:42:50 -07:00
|
|
|
$split && return 0
|
2009-06-04 23:35:24 -07:00
|
|
|
|
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
|
2011-04-20 04:42:30 -07:00
|
|
|
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
|
2011-11-09 08:14:23 -08:00
|
|
|
_xinetd_services
|
2009-10-04 10:42:50 -07:00
|
|
|
fi
|
|
|
|
fi
|
2009-06-04 23:35:24 -07:00
|
|
|
} &&
|
|
|
|
complete -F _chkconfig chkconfig
|
2009-10-01 10:54:51 -07:00
|
|
|
|
2009-10-04 10:42:50 -07:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|