have lliurex-access-control-cli && _lliurex-access-control-cli() { local cur prev opts base COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" # # The basic options we'll complete. # opts="currentconfig lockgroup unlockgroup disablecontrolgroup enablecontrolgroup lockuser unlockuser disablecontroluser enablecontroluser removeuserfromlist removeuserlist setcenter removecenter disablecontrolcenter enablecontrolcenter help" case "${prev}" in currentconfig) local running="groups users center all" COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) return 0 ;; lockgroup | unlockgroup) local groups="students teachers" COMPREPLY=( $(compgen -W "${groups}" -- ${cur}) ) return 0 ;; *) COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 ;; esac } [ "$have" ] && complete -F _lliurex-access-control-cli lliurex-access-control-cli