__satcmd() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" opts="--help --verbose --debug --version --version-semver" case "$cur" in --*) COMPREPLY=( $(compgen -W "$opts" -- ${cur}) ) ;; *) COMPREPLY=( $(compgen -W "$(satcmd _ls_subcommands)" ${cur}) ) esac } complete -F __satcmd satcmd