Ticket #6661: completion_fix.diff

File completion_fix.diff, 1.5 KB (added by Soeren Sonnenburg <bugreports@…>, 7 years ago)

proposed fix

  • /

    old new  
    6262          ||
    6363          # python manage.py, /some/path/python manage.py (if manage.py exists)
    6464          ( ${COMP_CWORD} -eq 2 &&
    65             ( $( basename ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
    66             ( $( basename ${COMP_WORDS[1]} ) == manage.py) &&
     65            ( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
     66            ( $( basename -- ${COMP_WORDS[1]} ) == manage.py) &&
    6767            ( -r ${COMP_WORDS[1]} ) )
    6868          ||
    6969          ( ${COMP_CWORD} -eq 2 &&
    70             ( $( basename ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
     70            ( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
    7171            (
    72                 ( $( basename ${COMP_WORDS[1]} ) == django-admin.py) ||
    73                 ( $( basename ${COMP_WORDS[1]} ) == django-admin)
     72                ( $( basename -- ${COMP_WORDS[1]} ) == django-admin.py) ||
     73                ( $( basename -- ${COMP_WORDS[1]} ) == django-admin)
    7474            ) &&
    7575            ( -r ${COMP_WORDS[1]} ) ) ]] ; then
    7676
     
    153153if command -v whereis &>/dev/null; then
    154154    python_interpreters=$(whereis python | cut -d " " -f 2-)
    155155    for python in $python_interpreters; do
    156         pythons="${pythons} $(basename $python)"
     156        pythons="${pythons} $(basename -- $python)"
    157157    done
    158158    pythons=$(echo $pythons | tr " " "\n" | sort -u | tr "\n" " ")
    159159else
Back to Top