Skip to content

Commit

Permalink
Fixed django#6661: fixed a bug with bash completion and python -i. Th…
Browse files Browse the repository at this point in the history
…anks, Soeren Sonnenburg.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Feb 25, 2008
1 parent 5ca0b92 commit aad8342
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extras/django_bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ _django_completion()
||
# python manage.py, /some/path/python manage.py (if manage.py exists)
( ${COMP_CWORD} -eq 2 &&
( $( basename ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
( $( basename ${COMP_WORDS[1]} ) == manage.py) &&
( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
( $( basename -- ${COMP_WORDS[1]} ) == manage.py) &&
( -r ${COMP_WORDS[1]} ) )
||
( ${COMP_CWORD} -eq 2 &&
( $( basename ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
( $( basename ${COMP_WORDS[1]} ) == django-admin.py) &&
( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
( $( basename -- ${COMP_WORDS[1]} ) == django-admin.py) &&
( -r ${COMP_WORDS[1]} ) ) ]] ; then

case ${cur} in
Expand Down Expand Up @@ -149,7 +149,7 @@ unset pythons
if command -v whereis &>/dev/null; then
python_interpreters=$(whereis python | cut -d " " -f 2-)
for python in $python_interpreters; do
pythons="${pythons} $(basename $python)"
pythons="${pythons} $(basename -- $python)"
done
pythons=$(echo $pythons | tr " " "\n" | sort -u | tr "\n" " ")
else
Expand Down

0 comments on commit aad8342

Please sign in to comment.