# Programmable completion for the django-admin commands. # Blatent ripoff of subversion completion # # Fawad Halim # Known to work with bash 2.05a with programmable completion and extended # pattern matching enabled (use 'shopt -s extglob progcomp' to enable # these if they are not already enabled). _django() { local cur cmds cmdOpts pOpts mOpts rOpts qOpts nOpts optsParam opt COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} cmds='adminindex init install sql sqlall sqlclear sqlindexes sqlinitialdata sqlreset \ sqlsequencereset startapp startproject' if [[ $COMP_CWORD -eq 1 ]] ; then COMPREPLY=( $( compgen -W "$cmds" -- $cur ) ) return 0 fi return 0 } complete -F _django -o default django-admin.py