vmstat: New completion.

master
Ville Skyttä 2012-02-21 22:00:39 +02:00
parent 91528b5271
commit bed5694111
4 changed files with 47 additions and 0 deletions

View File

@ -321,6 +321,7 @@ bashcomp_DATA = a2x \
usermod \
valgrind \
vipw \
vmstat \
vncviewer \
vpnc \
watch \

27
completions/vmstat Normal file
View 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

View File

@ -0,0 +1 @@
assert_source_completions vmstat

View File

@ -0,0 +1,18 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "vmstat -"
sync_after_int
teardown