# id(1) completion -*- shell-script -*- proc _id { local cur prev words cword _init_completion || return if [[ "$cur" == -* ]] { local opts=$[ _parse_help $1] [[ $opts ]] || setglobal opts = '"-G -g -u'" # POSIX fallback setglobal COMPREPLY = ''( $( compgen -W "$opts" -- "$cur" ) ) } else { setglobal COMPREPLY = ''( $( compgen -u "$cur" ) ) } } && complete -F _id id # ex: ts=4 sw=4 et filetype=sh