vmstat: New completion.
This commit is contained in:
parent
91528b5271
commit
bed5694111
@ -321,6 +321,7 @@ bashcomp_DATA = a2x \
|
|||||||
usermod \
|
usermod \
|
||||||
valgrind \
|
valgrind \
|
||||||
vipw \
|
vipw \
|
||||||
|
vmstat \
|
||||||
vncviewer \
|
vncviewer \
|
||||||
vpnc \
|
vpnc \
|
||||||
watch \
|
watch \
|
||||||
|
27
completions/vmstat
Normal file
27
completions/vmstat
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# vmstat(8) completion -*- shell-script -*-
|
||||||
|
|
||||||
|
_vmstat()
|
||||||
|
{
|
||||||
|
local cur prev words cword
|
||||||
|
_init_completion || return
|
||||||
|
|
||||||
|
case $prev in
|
||||||
|
-V|-c|-M|-N|-n|-w|-p)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
-S)
|
||||||
|
[[ $OSTYPE == *linux* ]] && \
|
||||||
|
COMPREPLY=( $( compgen -W 'k K m M' -- "$cur" ) )
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ $cur == -* ]]; then
|
||||||
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||||
|
[[ $COMPREPLY ]] || \
|
||||||
|
COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
|
||||||
|
fi
|
||||||
|
} &&
|
||||||
|
complete -F _vmstat vmstat
|
||||||
|
|
||||||
|
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/vmstat.exp
Normal file
1
test/completion/vmstat.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions vmstat
|
18
test/lib/completions/vmstat.exp
Normal file
18
test/lib/completions/vmstat.exp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
assert_complete_any "vmstat -"
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user