Ticket #7268: 02_bash_completion.diff

File 02_bash_completion.diff, 1.4 KB (added by Raphael Hertzog <hertzog@…>, 17 years ago)

Make bash completion file recognize "django-admin" command

  • extras/

    old new _django_completion()  
    5353    action_shell_opts="--plain"
    5454    action_runfcgi_opts="host port socket method maxspare minspare maxchildren daemonize pidfile workdir"
    5555
    56     if [[ # django-admin.py, ./manage, manage.py
     56    if [[ # django-admin.py, django-admin, ./manage, manage.py
    5757          ( ${COMP_CWORD} -eq 1 &&
    5858            ( ${COMP_WORDS[0]} == django-admin.py ||
     59              ${COMP_WORDS[0]} == django-admin ||
    5960              ${COMP_WORDS[0]} == ./manage.py ||
    6061              ${COMP_WORDS[0]} == manage.py ) )
    6162          ||
    _django_completion()  
    6869          ( ${COMP_CWORD} -eq 2 &&
    6970            ( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
    7071            ( $( basename -- ${COMP_WORDS[1]} ) == django-admin.py) &&
     72            ( -r ${COMP_WORDS[1]} ) )
     73          ||
     74          ( ${COMP_CWORD} -eq 2 &&
     75            ( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
     76            ( $( basename -- ${COMP_WORDS[1]} ) == django-admin) &&
    7177            ( -r ${COMP_WORDS[1]} ) ) ]] ; then
    7278
    7379        case ${cur} in
    _django_completion()  
    142148    fi
    143149}
    144150
    145 complete -F _django_completion django-admin.py manage.py
     151complete -F _django_completion django-admin.py manage.py django-admin
    146152
    147153# Support for multiple interpreters.
    148154unset pythons
Back to Top