Code

Ticket #6661: bash_completion.diff

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

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

Line 
1Index: extras/django_bash_completion
2===================================================================
3--- extras/django_bash_completion       (revision 7138)
4+++ extras/django_bash_completion       (working copy)
5@@ -61,13 +61,13 @@
6           ||
7           # python manage.py, /some/path/python manage.py (if manage.py exists)
8           ( ${COMP_CWORD} -eq 2 &&
9-            ( $( basename ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
10-            ( $( basename ${COMP_WORDS[1]} ) == manage.py) &&
11+            ( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
12+            ( $( basename -- ${COMP_WORDS[1]} ) == manage.py) &&
13             ( -r ${COMP_WORDS[1]} ) )
14           ||
15           ( ${COMP_CWORD} -eq 2 &&
16-            ( $( basename ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
17-            ( $( basename ${COMP_WORDS[1]} ) == django-admin.py) &&
18+            ( $( basename -- ${COMP_WORDS[0]} ) == python?([1-9]\.[0-9]) ) &&
19+            ( $( basename -- ${COMP_WORDS[1]} ) == django-admin.py) &&
20             ( -r ${COMP_WORDS[1]} ) ) ]] ; then
21 
22         case ${cur} in
23@@ -149,7 +149,7 @@
24 if command -v whereis &>/dev/null; then
25     python_interpreters=$(whereis python | cut -d " " -f 2-)
26     for python in $python_interpreters; do
27-        pythons="${pythons} $(basename $python)"
28+        pythons="${pythons} $(basename -- $python)"
29     done
30     pythons=$(echo $pythons | tr " " "\n" | sort -u | tr "\n" " ")
31 else