[Bash-completion-devel] [bash-completion-Bugs][312832] perl module completion does not work for 2nd level and beyond package items

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Tue Nov 16 22:07:30 UTC 2010


Bugs item #312832, was changed at 2010-11-16 21:16 by Guillaume Rousse
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312832&group_id=100114

>Status: Closed
Priority: 3
Submitted By: Ville Skyttä  (scop-guest)
Assigned to: Guillaume Rousse (guillomovitch-guest)
Summary: perl module completion does not work for 2nd level and beyond package items 
Distribution: None
Originally reported in: None
Milestone: None
Status: None
Original bug number: 


Initial Comment:
perl module completion in current git does not work for 2nd level (and beyond) package items, for example "perl -MFile::Sp<TAB>" returns no completions whereas it should return a bunch of File::Spec* ones.

I don't quite follow the logic there yet, but there's something wrong with the "return immediately if the base doesn't match" logic in helpers/perl - commenting that "return" out seems to fix it (and naturally makes things slower).  Changing the condition to "return if $base && $base !~ /^\Q$word/ && $word !~ /^\Q$base/;" fixes it as well but somehow that feels wrong/ugly to me at the moment and I don't know if it has undesirable side effects.  Could you have a look?

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

>Comment By: Guillaume Rousse (guillomovitch-guest)
Date: 2010-11-16 22:07

Message:
Unfortunatly, it seems the only other solution to the double comparaison would be to sort strings according to their lengths to identify wich one has to be matched against the other... I didn't benchmarked both solution, but I guess 2 anchored regexp are quicker than two calls to lenght() and a conditional construct.

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

Comment By: Ville Skyttä  (scop-guest)
Date: 2010-11-16 21:23

Message:
Some test cases added:
http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=c4eaba6

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

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



More information about the Bash-completion-devel mailing list