[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-393-gbd07926

Ville Skyttä ville.skytta at iki.fi
Fri Jul 1 17:24:44 UTC 2011


The following commit has been merged in the master branch:
commit bd07926f653a2e158b9f2d5f75c306c763fefa34
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Jul 1 20:24:14 2011 +0300

    host: New completion.

diff --git a/completions/bind-utils b/completions/bind-utils
index 3131119..dcb413a 100644
--- a/completions/bind-utils
+++ b/completions/bind-utils
@@ -1,6 +1,6 @@
 # bash completion for nslookup
 
-have nslookup || return
+have nslookup || have host || return
 
 _bind_queryclass()
 {
@@ -45,6 +45,35 @@ _nslookup()
 } &&
 complete -F _nslookup nslookup
 
+_host()
+{
+    local cur prev words cword
+    _init_completion || return
+
+    case $prev in
+        -c)
+            _bind_queryclass
+            return
+            ;;
+        -t)
+            _bind_querytype
+            return
+            ;;
+        -m)
+            COMPREPLY=( $( compgen -W 'trace record usage' -- "$cur" ) )
+            return
+            ;;
+        -N|-R|-W)
+            return
+            ;;
+    esac
+
+    if [[ $cur == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+    fi
+} &&
+complete -F _host host
+
 # Local variables:
 # mode: shell-script
 # sh-basic-offset: 4
diff --git a/test/completion/host.exp b/test/completion/host.exp
new file mode 100644
index 0000000..9866e1e
--- /dev/null
+++ b/test/completion/host.exp
@@ -0,0 +1 @@
+assert_source_completions host
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/host.exp
similarity index 80%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/host.exp
index 77cd07f..7308182 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/host.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "a2ps "
+assert_complete_any "host -"
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list