[Bash-completion-devel] Bug#496828: findutils: unexpected -path behaviour

David Paleino d.paleino at gmail.com
Sat Sep 6 13:59:48 UTC 2008


Hello Benoît,

(sorry for missing headers, I'm "manually quoting").

Benoît Dejean wrote:
> I use bash-completion.
> When i'm in my ~ and want to run a java program,
> i type 'java P<tab>' to actually run 'java Prime',
> then bash spawns a
> 
> find . -type f -path ./P*.class

James Youngman wrote:
> find . -maxdepth 1 \( -type f -name 'P*.class' \) -o \( -type d -name 'P*' \)
> 
> However, this will not return ./P/Q/R/S/T/foo.class, even if that is
> the only class file below the current directory, so there is a change
> in functionality in my proposal.

I do really believe we don't want automatic research of classes in
subdirectories. A simple "_filedir" completion should do the trick (obviously,
files restricted to *.class, and all the directories).

So, if foo.class is the only class below the cwd, you'd have to do multiple
<TAB>s, to go in the correct directory where the .class is. Otherwise, that find
command you cited is the only option, to correctly search for .class files.

In the case James cited, would multiple <TAB>s be a desired behaviour? I
believe yes, since one should know where the class file is...

I'm fixing this bug (rev1167) by just adding "-maxdepth 1", but I'll wait for a
reply in case you want me to revert the change. Moreover, a new bug appeared:

$ ls
foo/
foo.class
$ java f<TAB>
$ java foo/

We should give precedence to files over directories, but I don't currently have
idea on how to do that.

To team: before releasing, look at the FIXME in the code, we'd probably better
revert the change if we find no solution.

Kindly,
David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20080906/09cb9f2e/attachment-0004.pgp 


More information about the Bash-completion-devel mailing list