arping: New completion.

master
Ville Skyttä 2011-09-28 19:04:55 +03:00
parent 89b7923cb8
commit 2014d3b45d
3 changed files with 52 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1 @@
assert_source_completions arping

View File

@ -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