Code

Ticket #1240: a_better_app_completion.diff

File a_better_app_completion.diff, 790 bytes (added by paolo <paolo@…>, 7 years ago)

A patch to improve application name completion

Line 
1Index: django_bash_completion
2===================================================================
3--- django_bash_completion      (revision 4584)
4+++ django_bash_completion      (working copy)
5@@ -60,6 +60,11 @@
6           ( ${COMP_CWORD} -eq 2 &&
7             ( $( basename ${COMP_WORDS[0]} ) == python ) &&
8             ( $( basename ${COMP_WORDS[1]} ) == manage.py) &&
9+            ( -r ${COMP_WORDS[1]} ) )
10+          ||
11+          ( ${COMP_CWORD} -eq 2 &&
12+            ( $( basename ${COMP_WORDS[0]} ) == python ) &&
13+            ( $( basename ${COMP_WORDS[1]} ) == django-admin.py) &&
14             ( -r ${COMP_WORDS[1]} ) ) ]] ; then
15 
16         case ${cur} in
17@@ -135,3 +140,4 @@
18 }
19 
20 complete -F _django_completion django-admin.py manage.py
21+complete -F _django_completion -o default python