summaryrefslogtreecommitdiffstats
path: root/completions/chkconfig
diff options
context:
space:
mode:
Diffstat (limited to 'completions/chkconfig')
-rw-r--r--completions/chkconfig26
1 files changed, 12 insertions, 14 deletions
diff --git a/completions/chkconfig b/completions/chkconfig
index 8ff6637..32c3392 100644
--- a/completions/chkconfig
+++ b/completions/chkconfig
@@ -1,37 +1,35 @@
# chkconfig(8) completion -*- shell-script -*-
-_chkconfig()
+_comp_cmd_chkconfig()
{
- local cur prev words cword split
- _init_completion -s || return
+ local cur prev words cword was_split comp_args
+ _comp_initialize -s -- "$@" || return
case $prev in
--level=[1-6] | [1-6] | --list | --add | --del | --override)
- _services
- _xinetd_services
+ _comp_compgen_services
+ _comp_compgen -a xinetd_services
return
;;
--level)
- COMPREPLY=($(compgen -W '{1..6}' -- "$cur"))
+ _comp_compgen -- -W '{1..6}'
return
;;
esac
- $split && return
+ [[ $was_split ]] && return
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '--list --add --del --override --level' \
- -- "$cur"))
+ _comp_compgen -- -W '--list --add --del --override --level'
else
if ((cword == 2 || cword == 4)); then
- COMPREPLY=($(compgen -W 'on off reset resetpriorities' \
- -- "$cur"))
+ _comp_compgen -- -W 'on off reset resetpriorities'
else
- _services
- _xinetd_services
+ _comp_compgen_services
+ _comp_compgen -a xinetd_services
fi
fi
} &&
- complete -F _chkconfig chkconfig
+ complete -F _comp_cmd_chkconfig chkconfig
# ex: filetype=sh