diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2011-09-28 19:04:55 +0300 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2011-09-28 19:04:55 +0300 |
commit | 2014d3b45d0a3f7abbe494b5f4861d4e40e461be (patch) | |
tree | 98779e28e12de63482371f42c03d7ba1396a1076 | |
parent | 89b7923cb8247e4bd1fa7d01c235c88d0e45cd24 (diff) | |
download | bash-completion-2014d3b45d0a3f7abbe494b5f4861d4e40e461be.tar.gz |
arping: New completion.
-rw-r--r-- | completions/iputils | 30 | ||||
-rw-r--r-- | test/completion/arping.exp | 1 | ||||
-rw-r--r-- | test/lib/completions/arping.exp | 21 |
3 files changed, 52 insertions, 0 deletions
diff --git a/completions/iputils b/completions/iputils index 8c36eb16..236cf878 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 00000000..5a64b1a3 --- /dev/null +++ b/test/completion/arping.exp @@ -0,0 +1 @@ +assert_source_completions arping diff --git a/test/lib/completions/arping.exp b/test/lib/completions/arping.exp new file mode 100644 index 00000000..531bb07f --- /dev/null +++ b/test/lib/completions/arping.exp @@ -0,0 +1,21 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "arping " +sync_after_int + +assert_complete_any "arping -" +sync_after_int + + +teardown |