Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 91060 - gentoo-bashcomp needs support for "equery files --filter=..."
Summary: gentoo-bashcomp needs support for "equery files --filter=..."
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-05-01 08:35 UTC by TGL
Modified: 2005-05-06 06:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
list_completion.sh (list_completion.sh,5.05 KB, text/plain)
2005-05-03 06:34 UTC, TGL
Details
equery_files_filter_completion.patch (equery_files_filter_completion.patch,6.14 KB, patch)
2005-05-03 12:24 UTC, TGL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TGL 2005-05-01 08:35:25 UTC
Aaron: I've seen your blog entry about the empty TODO, so here is one item you can add.

"equery files" has an option which doesn't appear in bash completion: "--filter=...".  For instance, "equery files --filter=doc,man,info bash" will list all bash documentation files.  See "equery files --help" for the complete synopsis.

Oh, and btw, completion for "equery <some_command> --" could also list "--help".
Comment 1 Aaron Walker (RETIRED) gentoo-dev 2005-05-01 09:05:09 UTC
Committed upstream.  Unfortunately, there's not an easy way to complete on --flag=arg1,arg2 type stuff, but it at least now completes on --filter=.

--help has been added to each subcommand.

Will be FIXED next release.
Comment 2 TGL 2005-05-03 00:57:01 UTC
I've written a function that does completion of "item1<sep>item2<sep>..." lists. Could you point me to the CVS repository of gentoo-bashcomp so that i try to integrate it with your latest update, because i couldn't its location on the CVS web interface (or maybe it's not there?).

Thanks.
Comment 3 TGL 2005-05-03 02:11:48 UTC
> Could you point me to the CVS repository of gentoo-bashcomp

Oh, ok, it's on BerliOS. Sorry for the stupid question.
Comment 4 TGL 2005-05-03 06:33:50 UTC
It seems that your update adding --help and --filter= is actually not yet on the BerliOS SVN repository, so i will attach the helper function i've wrote and let you integrate it in equery completion code (if you agree sure).

Basically, it would be something like that: when ${cur} matches --filter=*, then
COMPREPLY=($(_list_compgen "${cur#--filter=}" , \
	dir,obj,sym,dev,fifo,path,conf,cmd,doc,man,info))

I'm not quite sure how readable was the _list_compgen() code, so i've added verbose comments to make it clear (feel free to remove them if that's much...). It's pure bash, and i think i've not used anything specific to version 3.
Comment 5 TGL 2005-05-03 06:34:54 UTC
Created attachment 57921 [details]
list_completion.sh
Comment 6 Aaron Walker (RETIRED) gentoo-dev 2005-05-03 07:39:07 UTC
ack.  guess it'd help if I actually committed it :)
Comment 7 TGL 2005-05-03 12:24:51 UTC
Created attachment 57950 [details, diff]
equery_files_filter_completion.patch

Here is a patch that adds the list completion function and uses it for
--filter=<list>. It's against current trunk version (49).
Comment 8 Aaron Walker (RETIRED) gentoo-dev 2005-05-06 06:26:46 UTC
20050506 is in CVS.  Awesome job on the function.
I hadn't yet figured out how to do that yet :)
Comment 9 TGL 2005-05-06 06:38:22 UTC
> Awesome job on the function.

Thanks. /me too gets bored at work sometime :)