Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 218341

Summary: eix based emerge bash-completion alternative?
Product: Gentoo Linux Reporter: Imre Péntek <pentek.imre>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED CANTFIX    
Severity: enhancement CC: raphael.droz+floss
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patched routine
diff

Description Imre Péntek 2008-04-18 22:44:31 UTC
emerge --pretend huns<tab>
takes a little bit more than 1 seconds to answer, but issuing command eix huns responds almost instantly. So maybe you should implement an eix based alternative for this tab completion. Thank you.

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-04-19 04:06:43 UTC
You could simply do `eix huns` and then use the results. Please reopen this bug when you have worked out how this should be implemented in bash-completion. Patches are welcome.
Comment 2 Imre Péntek 2008-06-09 14:17:02 UTC
Created attachment 156083 [details]
patched routine
Comment 3 Imre Péntek 2008-06-09 14:17:40 UTC
Created attachment 156085 [details, diff]
diff
Comment 4 Imre Péntek 2008-06-09 14:20:51 UTC
maybe there are other places when eix would be applicable, anyways this can be at least considered as a proof-of-concept about the fact eix can be used for this task.
Comment 5 Raphaël Droz 2009-11-20 17:24:32 UTC
The rule of bash_completion is that the command being completed (or it's mandatory depedancies may be used to complete)
[eg, perl completion can use perl, eix completion can use eix]
But emerge cannot, anyway I think that using one of the following would be acceptable :
[[ -x "$(whereis eix 2> /dev/null)" ]]
or
if $(type _eix 2>/dev/null); ...

Then instead of using :
for x in ${cat}/${pkg}/*.ebuild
it would be, eg l.486 :
eix -C ${cat} ${pkg}

The second way of testing first needs the eix completion to be done...

Maybe such thing would let (if desired) :
emerge sys<tab>
lists
sys-, sysfsutils, sysload, ... and not only category beginning with sys ?

(In reply to comment #4)
> maybe there are other places when eix would be applicable, anyways this can be
> at least considered as a proof-of-concept about the fact eix can be used for
> this task.
>