[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-91-g22c8330

Ville Skyttä ville.skytta at iki.fi
Wed Apr 20 14:19:58 UTC 2011


The following commit has been merged in the master branch:
commit d82571a47cf83ae52ea71d6272b8f040cf5700c6
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Apr 20 17:04:20 2011 +0300

    Use _init_completion() in completions/h*.

diff --git a/completions/heimdal b/completions/heimdal
index 394c713..e909d8c 100644
--- a/completions/heimdal
+++ b/completions/heimdal
@@ -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
diff --git a/completions/hping2 b/completions/hping2
index c9bd1e0..9f20fa2 100644
--- a/completions/hping2
+++ b/completions/hping2
@@ -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)

-- 
bash-completion



More information about the Bash-completion-commits mailing list