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

View File

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