my Python program can be launched with a range of different options (or subcommands) like:
$ myProgram doSomething
$ myProgram doSomethingElse
$ myProgram no
Create a file "myprog-completion.bash" and source it in your .bashrc file. Something like this to get you started...
_myProgram()
{
cur=${COMP_WORDS[COMP_CWORD]}
case "${cur}" in
d*) use="doSomething" ;;
n*) use="nowDoSomethingElse" ;;
esac
COMPREPLY=( $( compgen -W "$use" -- $cur ) )
}
complete -o default -o nospace -F _myProgram myProgram