# chpasswd(8) completion -*- shell-script -*- proc _chpasswd { local cur prev words cword split _init_completion -s || return match $prev { with -c|--crypt setglobal COMPREPLY = ''( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \ -- "$cur" ) ) return 0 with -s|--sha-rounds return 0 } $split && return 0 setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _chpasswd chpasswd # ex: ts=4 sw=4 et filetype=sh