severity 450913 important tag 450913 + patch found 450913 0.97~svn7047-2 thanks
On Mon, 2007-11-12 at 08:35 +0100, Raphael Hertzog wrote: > On Mon, 12 Nov 2007, Soeren Sonnenburg wrote: > > Package: python-django > > Version: 0.96+svn6020-1 > > Severity: normal > > > > consider there is a package foo.py in the current directory, then > > > > $ python -i fo<tab> > > > > will fail like: > > > > $ python -i fobasename: invalid option -- i > > Try `basename --help' for more information. > > The fix is obvious. Replace in the django completion file all occurences > of "basename something" by "basename -- something". Any news on this? The bug is still in 0.97~svn7047-2. I attaching your proposed fix - which works nicely for me... Best, Soeren
--- /etc/bash_completion.d/django_bash_completion 2008-02-21 18:15:16.000000000 +0100 +++ /tmp/new 2008-02-21 18:15:13.000000000 +0100 @@ -62,15 +62,15 @@ || # 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[0]} ) == python?([1-9]\.[0-9]) ) && ( - ( $( basename ${COMP_WORDS[1]} ) == django-admin.py) || - ( $( basename ${COMP_WORDS[1]} ) == django-admin) + ( $( basename -- ${COMP_WORDS[1]} ) == django-admin.py) || + ( $( basename -- ${COMP_WORDS[1]} ) == django-admin) ) && ( -r ${COMP_WORDS[1]} ) ) ]] ; then @@ -153,7 +153,7 @@ 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