[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-441-g2014d3b

Ville Skyttä ville.skytta at iki.fi
Wed Sep 28 16:07:31 UTC 2011


The following commit has been merged in the master branch:
commit 2014d3b45d0a3f7abbe494b5f4861d4e40e461be
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Sep 28 19:04:55 2011 +0300

    arping: New completion.

diff --git a/completions/iputils b/completions/iputils
index 8c36eb1..236cf87 100644
--- a/completions/iputils
+++ b/completions/iputils
@@ -79,6 +79,36 @@ _tracepath()
 } &&
 complete -F _tracepath tracepath tracepath6
 
+
+have arping &&
+_arping()
+{
+    local cur prev words cword
+    _init_completion || return
+
+    case $prev in
+        -c|-w)
+            return
+            ;;
+        -I)
+            _available_interfaces -a
+            return
+            ;;
+        -s)
+            _ip_addresses
+            return
+            ;;
+    esac
+
+    if [[ $cur == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) )
+        return
+    fi
+
+    _known_hosts_real "$cur"
+} &&
+complete -F _arping arping
+
 # Local variables:
 # mode: shell-script
 # sh-basic-offset: 4
diff --git a/test/completion/arping.exp b/test/completion/arping.exp
new file mode 100644
index 0000000..5a64b1a
--- /dev/null
+++ b/test/completion/arping.exp
@@ -0,0 +1 @@
+assert_source_completions arping
diff --git a/test/lib/completions/ping.exp b/test/lib/completions/arping.exp
similarity index 68%
copy from test/lib/completions/ping.exp
copy to test/lib/completions/arping.exp
index 9ef7f2f..531bb07 100644
--- a/test/lib/completions/ping.exp
+++ b/test/lib/completions/arping.exp
@@ -11,10 +11,10 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "ping "
+assert_complete_any "arping "
 sync_after_int
 
-assert_complete_any "ping -"
+assert_complete_any "arping -"
 sync_after_int
 
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list