#!/bin/bash __satcmd() { local cur opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" opts="--help --verbose --debug --version --version-semver" case "$cur" in --*) COMPREPLY=( $(compgen -W "$opts" -- "${cur}") ) ;; *) COMPREPLY=( $(compgen -W "$(satcmd _ls_sc)" "${cur}") ) esac } complete -F __satcmd satcmd