1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Fixed #6661: fixed a bug with bash completion and python -i. Thanks, Soeren Sonnenburg.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2008-02-25 19:38:09 +00:00
parent 5ca0b9203b
commit aad8342aa4

View File

@ -61,13 +61,13 @@ _django_completion()
|| ||
# python manage.py, /some/path/python manage.py (if manage.py exists) # python manage.py, /some/path/python manage.py (if manage.py exists)
( ${COMP_CWORD} -eq 2 && ( ${COMP_CWORD} -eq 2 &&
( $( basename ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) && ( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
( $( basename ${COMP_WORDS[1]} ) == manage.py) && ( $( basename -- ${COMP_WORDS[1]} ) == manage.py) &&
( -r ${COMP_WORDS[1]} ) ) ( -r ${COMP_WORDS[1]} ) )
|| ||
( ${COMP_CWORD} -eq 2 && ( ${COMP_CWORD} -eq 2 &&
( $( basename ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) && ( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
( $( basename ${COMP_WORDS[1]} ) == django-admin.py) && ( $( basename -- ${COMP_WORDS[1]} ) == django-admin.py) &&
( -r ${COMP_WORDS[1]} ) ) ]] ; then ( -r ${COMP_WORDS[1]} ) ) ]] ; then
case ${cur} in case ${cur} in
@ -149,7 +149,7 @@ unset pythons
if command -v whereis &>/dev/null; then if command -v whereis &>/dev/null; then
python_interpreters=$(whereis python | cut -d " " -f 2-) python_interpreters=$(whereis python | cut -d " " -f 2-)
for python in $python_interpreters; do for python in $python_interpreters; do
pythons="${pythons} $(basename $python)" pythons="${pythons} $(basename -- $python)"
done done
pythons=$(echo $pythons | tr " " "\n" | sort -u | tr "\n" " ") pythons=$(echo $pythons | tr " " "\n" | sort -u | tr "\n" " ")
else else