Ticket #6661: bash_completion.diff

File bash_completion.diff, 1.4 KB (added by ubernostrum, 7 years ago)

Same patch, slightly more amenable to a straight 'patch' application

  • extras/django_bash_completion

     
    6161          ||
    6262          # python manage.py, /some/path/python manage.py (if manage.py exists)
    6363          ( ${COMP_CWORD} -eq 2 &&
    64             ( $( basename ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
    65             ( $( basename ${COMP_WORDS[1]} ) == manage.py) &&
     64            ( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
     65            ( $( basename -- ${COMP_WORDS[1]} ) == manage.py) &&
    6666            ( -r ${COMP_WORDS[1]} ) )
    6767          ||
    6868          ( ${COMP_CWORD} -eq 2 &&
    69             ( $( basename ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
    70             ( $( basename ${COMP_WORDS[1]} ) == django-admin.py) &&
     69            ( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
     70            ( $( basename -- ${COMP_WORDS[1]} ) == django-admin.py) &&
    7171            ( -r ${COMP_WORDS[1]} ) ) ]] ; then
    7272
    7373        case ${cur} in
     
    149149if command -v whereis &>/dev/null; then
    150150    python_interpreters=$(whereis python | cut -d " " -f 2-)
    151151    for python in $python_interpreters; do
    152         pythons="${pythons} $(basename $python)"
     152        pythons="${pythons} $(basename -- $python)"
    153153    done
    154154    pythons=$(echo $pythons | tr " " "\n" | sort -u | tr "\n" " ")
    155155else
Back to Top