First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 91060
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Shell Tools Herd Bugs <shell-tools@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: TGL <tom.gl@free.fr>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
list_completion.sh list_completion.sh text/plain TGL 2005-05-03 06:34 0000 5.05 KB Details
equery_files_filter_completion.patch equery_files_filter_completion.patch patch TGL 2005-05-03 12:24 0000 6.14 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 91060 depends on: Show dependency tree
Show dependency graph
Bug 91060 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-05-01 08:35 0000
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 From Aaron Walker (RETIRED) 2005-05-01 09:05:09 0000 -------
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 From TGL 2005-05-03 00:57:01 0000 -------
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 From TGL 2005-05-03 02:11:48 0000 -------
> Could you point me to the CVS repository of gentoo-bashcomp

Oh, ok, it's on BerliOS. Sorry for the stupid question.

------- Comment #4 From TGL 2005-05-03 06:33:50 0000 -------
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 From TGL 2005-05-03 06:34:54 0000 -------
Created an attachment (id=57921) [edit]
list_completion.sh

------- Comment #6 From Aaron Walker (RETIRED) 2005-05-03 07:39:07 0000 -------
ack.  guess it'd help if I actually committed it :)

------- Comment #7 From TGL 2005-05-03 12:24:51 0000 -------
Created an attachment (id=57950) [edit]
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 From Aaron Walker (RETIRED) 2005-05-06 06:26:46 0000 -------
20050506 is in CVS.  Awesome job on the function.
I hadn't yet figured out how to do that yet :)

------- Comment #9 From TGL 2005-05-06 06:38:22 0000 -------
> Awesome job on the function.

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

First Last Prev Next    No search results available      Search page      Enter new bug