[Bash-completion-devel] [bash-completion-Bugs][312959] Bug in Python completion using paths

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Sat Jan 29 21:22:48 UTC 2011


Bugs item #312959, was changed at 2011-01-28 16:49 by Ville Skyttä 
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312959&group_id=100114

>Status: Closed
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: Bug in Python completion using paths 
Distribution: None
Originally reported in: None
>Milestone: 1.3
Status: None
Original bug number: 


Initial Comment:
Anonymous message posted by debian at oursours.net

I originally reported this bug to Archlinux: https://bugs.archlinux.org/task/20257

The following change fixes the problem for me while apparently not breaking anything:

--- python.orig	2011-01-28 15:39:38.000000972 +0100
+++ python	2011-01-28 15:32:45.733334505 +0100
@@ -23,7 +23,7 @@
         return 0
         ;;
     !(python|-?))
-        [[ ${COMP_WORDS[COMP_CWORD-2]} != -@(Q|W) ]] && _filedir
+        [[ ${COMP_WORDS[COMP_CWORD-1]} != -@(Q|W) ]] && _filedir
         ;;
     esac

But don't take my word, I'm just a beginner at completion (I just wrote my first script yesterday).

It still doesn't complete when the command is a path, e.g. "/usr/bin/python". I'm curious how you enable completion for all commands where the basename is "python".

By the way, you should consider enabling this completion for all "versionned" binaries: python2, python2.7, python3, python3.1

----------------------------------------------------------------------

>Comment By: Ville Skyttä  (scop-guest)
Date: 2011-01-29 23:22

Message:
Already fixed in git.

http://git.debian.org/?p=bash-completion/bash-completion.git;a=history;f=completions/python;h=17f96f50e1cd87c1a9aea93bdfcd74b988d81159;hb=HEAD

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312959&group_id=100114



More information about the Bash-completion-devel mailing list