nethogs: New completion.
This commit is contained in:
parent
2e859f1a6c
commit
f271d7e8db
@ -199,6 +199,7 @@ bashcomp_DATA = a2x \
|
|||||||
mysql \
|
mysql \
|
||||||
mysqladmin \
|
mysqladmin \
|
||||||
ncftp \
|
ncftp \
|
||||||
|
nethogs \
|
||||||
newgrp \
|
newgrp \
|
||||||
newlist \
|
newlist \
|
||||||
newusers \
|
newusers \
|
||||||
|
25
completions/nethogs
Normal file
25
completions/nethogs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# bash completion for nethogs(8) -*- shell-script -*-
|
||||||
|
|
||||||
|
_nethogs()
|
||||||
|
{
|
||||||
|
local cur prev words cword
|
||||||
|
_init_completion || return
|
||||||
|
|
||||||
|
case "$prev" in
|
||||||
|
-d)
|
||||||
|
# expect integer value
|
||||||
|
COMPREPLY+=( $( compgen -W '{0..9}' ) )
|
||||||
|
compopt -o nospace
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h )' -- "$cur" ) )
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
_available_interfaces -a
|
||||||
|
} && complete -F _nethogs nethogs
|
||||||
|
|
||||||
|
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/nethogs.exp
Normal file
1
test/completion/nethogs.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions nethogs
|
20
test/lib/completions/nethogs.exp
Normal file
20
test/lib/completions/nethogs.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "nethogs "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user