Add iftop(8) completion.
This commit is contained in:
parent
0630139697
commit
c78db545f5
2
CHANGES
2
CHANGES
@ -8,7 +8,7 @@ bash-completion (2.x)
|
|||||||
|
|
||||||
[ Ville Skyttä ]
|
[ Ville Skyttä ]
|
||||||
* Activate hping2 completion also for hping and hping3.
|
* Activate hping2 completion also for hping and hping3.
|
||||||
* Add crontab, lrzip, and POSIX sh completions.
|
* Add crontab, iftop, lrzip, and POSIX sh completions.
|
||||||
* Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
|
* Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
|
||||||
filename completions.
|
filename completions.
|
||||||
* Add "short" tarball extensions to unxz, unlzma etc completions.
|
* Add "short" tarball extensions to unxz, unlzma etc completions.
|
||||||
|
@ -51,6 +51,7 @@ static_bashcomp = abook \
|
|||||||
heimdal \
|
heimdal \
|
||||||
hping2 \
|
hping2 \
|
||||||
iconv \
|
iconv \
|
||||||
|
iftop \
|
||||||
ifupdown \
|
ifupdown \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
info \
|
info \
|
||||||
|
35
contrib/iftop
Normal file
35
contrib/iftop
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# iftop(8) completion
|
||||||
|
|
||||||
|
have iftop &&
|
||||||
|
_iftop()
|
||||||
|
{
|
||||||
|
COMPREPLY=()
|
||||||
|
local cur prev
|
||||||
|
_get_comp_words_by_ref cur prev
|
||||||
|
|
||||||
|
case $prev in
|
||||||
|
-h|-f|-F|-m)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
-i)
|
||||||
|
_available_interfaces -a
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
-c)
|
||||||
|
_filedir
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
COMPREPLY=( $( compgen -W '-h -n -N -p -P -b -B -i -f -F -c -m' \
|
||||||
|
-- "$cur" ) )
|
||||||
|
} &&
|
||||||
|
complete -F _iftop -o filenames iftop
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-basic-offset: 4
|
||||||
|
# sh-indent-comment: t
|
||||||
|
# indent-tabs-mode: nil
|
||||||
|
# End:
|
||||||
|
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/iftop.exp
Normal file
1
test/completion/iftop.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions iftop
|
20
test/lib/completions/iftop.exp
Normal file
20
test/lib/completions/iftop.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "iftop "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user