# pidof(8) completion -*- shell-script -*- proc _pidof { local cur prev words cword _init_completion || return match $prev { with -h|--help|-V|--version return with -o|--omit-pid _pids return } if [[ $cur == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) return } _pnames } && complete -F _pidof pidof # ex: ts=4 sw=4 et filetype=sh