# vmstat(8) completion -*- shell-script -*- proc _vmstat { var cur = '', prev = '', words = '', cword = '' _init_completion || return match $prev { with -h|--help|-V|--version|-c|-M|-N|-n|-w|-p|--partition return with -S|--unit [[ $OSTYPE == *linux* ]] && \ setglobal COMPREPLY = '( '$( compgen -W 'k K m M' -- "$cur" ) ) return } if [[ $cur == -* ]] { setglobal COMPREPLY = '( '$( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY ]] || \ setglobal COMPREPLY = '( '$( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) } } && complete -F _vmstat vmstat # ex: ts=4 sw=4 et filetype=sh