arping: New completion.
This commit is contained in:
parent
89b7923cb8
commit
2014d3b45d
@ -79,6 +79,36 @@ _tracepath()
|
|||||||
} &&
|
} &&
|
||||||
complete -F _tracepath tracepath tracepath6
|
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:
|
# Local variables:
|
||||||
# mode: shell-script
|
# mode: shell-script
|
||||||
# sh-basic-offset: 4
|
# sh-basic-offset: 4
|
||||||
|
1
test/completion/arping.exp
Normal file
1
test/completion/arping.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions arping
|
21
test/lib/completions/arping.exp
Normal file
21
test/lib/completions/arping.exp
Normal 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
|
Loading…
x
Reference in New Issue
Block a user