Use _init_completion() in completions/h*.

This commit is contained in:
Ville Skyttä 2011-04-20 17:04:20 +03:00
parent 10f6eb8ee2
commit d82571a47c
2 changed files with 8 additions and 11 deletions

View File

@ -23,10 +23,10 @@ _heimdal_encodings()
_ktutil() _ktutil()
{ {
local cur prev command options split=false local cur prev words cword
_init_completion || return
COMPREPLY=() local command options split=false
_get_comp_words_by_ref cur prev
_split_longopt && split=true _split_longopt && split=true
@ -58,15 +58,15 @@ _ktutil()
commands='add change copy get list remove rename purge srvconvert \ commands='add change copy get list remove rename purge srvconvert \
srv2keytab srvcreate key2srvtab' srv2keytab srvcreate key2srvtab'
for (( i=1; i < COMP_CWORD; i++ )); do for (( i=1; i < cword; i++ )); do
case ${COMP_WORDS[i]} in case ${words[i]} in
-k|--keytab) -k|--keytab)
i=$(($i+1)) i=$(($i+1))
;; ;;
-*) -*)
;; ;;
*) *)
command=${COMP_WORDS[i]} command=${words[i]}
break break
;; ;;
esac esac

View File

@ -4,11 +4,8 @@ have hping || have hping2 || have hping3 || return
_hping2() _hping2()
{ {
local cur prev local cur prev words cword
_init_completion || return
COMPREPLY=()
cur=`_get_cword`
prev=`_get_pword`
case $prev in case $prev in
-I|--interface) -I|--interface)