# hostname(1) completion -*- shell-script -*- proc _hostname { local cur prev words cword _init_completion || return match $prev { with -h|--help|-V|--version return with -F|--file _filedir return } [[ $cur == -* ]] && \ setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) } && complete -F _hostname hostname # ex: ts=4 sw=4 et filetype=sh