File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ complete -F _django_completion -o default django-admin.py manage.py django-admin
4242_python_django_completion()
4343{
4444 if [[ ${COMP_CWORD} -ge 2 ]]; then
45- PYTHON_EXE=${COMP_WORDS[0]##*/}
45+ local PYTHON_EXE=${COMP_WORDS[0]##*/}
4646 echo $PYTHON_EXE | egrep "python([2-9]\.[0-9])?" >/dev/null 2>&1
4747 if [[ $? == 0 ]]; then
48- PYTHON_SCRIPT=${COMP_WORDS[1]##*/}
48+ local PYTHON_SCRIPT=${COMP_WORDS[1]##*/}
4949 echo $PYTHON_SCRIPT | egrep "manage\.py|django-admin(\.py)?" >/dev/null 2>&1
5050 if [[ $? == 0 ]]; then
5151 COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]:1}" \
@@ -63,9 +63,11 @@ if command -v whereis &>/dev/null; then
6363 for python in $python_interpreters; do
6464 pythons="${pythons} ${python##*/}"
6565 done
66+ unset python_interpreters
6667 pythons=$(echo $pythons | tr " " "\n" | sort -u | tr "\n" " ")
6768else
6869 pythons=python
6970fi
7071
7172complete -F _python_django_completion -o default $pythons
73+ unset pythons
You can’t perform that action at this time.
0 commit comments