# *** Public Domain *** COMP_WORDBREAKS=${COMP_WORDBREAKS/=/} export COMP_WORDBREAKS _cfgadm () { local cur prev COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} case "$prev" in -c) COMPREPLY=( $(compgen -W "insert remove disconnect connect configure unconfigure" -- $cur) ) ;; -s) COMPREPLY=( $(compgen -W "select= match= sort= cols= cols2= delim= noheadings" -- "${cur##*,}") ) local existing_opts=$(expr "$cur" : '\(.*,\)') if [[ "$existing_opts" != "" ]]; then COMPREPLY=( "${COMPREPLY[@]/#/${existing_opts}}" ) fi compopt -o nospace ;; *) COMPREPLY=( $(compgen -W "-f -v -h -l -o -s -y -t" -- $cur) ) ;; esac } complete -F _cfgadm cfgadm