Bug#918430: find /tmp/ -path /tm<TAB>

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#918430: find /tmp/ -path /tm<TAB>

積丹尼 Dan Jacobson
Package: bash-completion
Version: 1:2.8-5
File: /usr/share/bash-completion/completions/find

No expansion is happening here:
$ find /tmp/ -path /tm<TAB>
Please make it happen. Thanks.

Reply | Threaded
Open this post in threaded view
|

Bug#918430: find /tmp/ -path /tm<TAB>

Gabriel F. T. Gomes-4
On 06 Jan 2019, 積丹尼 Dan Jacobson wrote:

>Package: bash-completion
>Version: 1:2.8-5
>File: /usr/share/bash-completion/completions/find
>
>No expansion is happening here:
>$ find /tmp/ -path /tm<TAB>
>Please make it happen. Thanks.

I'm trying to understand what's the use case you want to enable.
I'll describe several scenarios:

1.
Suppose you have the following directories:

  $ ls -d /tmp/find-*
  /tmp/find-bar  /tmp/find-foo

If I make find /tmp -path /tmp/fi<TAB> complete with directories, it
will complete to:

  $ find /tmp -path /tmp/fi<TAB>
  $ find /tmp -path /tmp/find-<CURSOR>

If you hit Enter after that, nothing will be found.

2.
Now suppose you only had one directory:

  $ ls -d /tmp/find-*
  /tmp/find-bar

Then the completion would look like:

  $ find /tmp -path /tmp/fi<TAB>
  $ find /tmp -path /tmp/find-bar/<CURSOR>

Again, nothing will be found, because of the trailing slash

3.
Take 2 as exemple, and remove the trailing slash

  $ find /tmp -path /tmp/find-bar<ENTER>

This works, but it's no different than:

  $ find /tmp/find-bar

which already works.

4.
Take 1 as example, but now, after completion, you add wildcard and quotes:

  $ find /tmp -path /tmp/fi<TAB>
  $ find /tmp -path /tmp/find-<CURSOR>
  $ find /tmp -path "/tmp/find-*"<ENTER>

Then it works, but it doesn't look like a good use case for completion.


What are you trying to do?


Cheers,
Gabriel

Reply | Threaded
Open this post in threaded view
|

Bug#918430: find /tmp/ -path /tm<TAB>

積丹尼 Dan Jacobson
In reply to this post by 積丹尼 Dan Jacobson
All I know is I can't get any expansion at all even here:
$ find . -path ./<TAB>

Why can't it ever expand anything at -path?

Is it because "the doctor thinks it is not good for me"?

Why not just let me expand filenames anyway?

Certainly there can be at least one use case.

Reply | Threaded
Open this post in threaded view
|

Bug#918430: find /tmp/ -path /tm<TAB>

Gabriel F. T. Gomes-4
On Sat, 26 Oct 2019, 積丹尼 Dan Jacobson wrote:

>All I know is I can't get any expansion at all even here:
>$ find . -path ./<TAB>

Yes, I confirm that it doesn't.

>Why can't it ever expand anything at -path?

I'm trying to understand what to expand, thus I need your help.

>Is it because "the doctor thinks it is not good for me"?

I don't know what this is supposed to mean.

>Why not just let me expand filenames anyway?

Do you mean directories?  I don't think it would make sense to pass
filenames to the -path option in find.

>Certainly there can be at least one use case.

Yes, that's what I'm trying to understand, so that I can implement it
accordingly.


Cheers,
Gabriel

Reply | Threaded
Open this post in threaded view
|

Bug#918430: find /tmp/ -path /tm<TAB>

積丹尼 Dan Jacobson
In reply to this post by 積丹尼 Dan Jacobson
>>>>> "GFTG" == Gabriel F T Gomes <[hidden email]> writes:

GFTG> I'm trying to understand what to expand, thus I need your help.

Maybe in the meantime expand everything, as it is hard to figure out
anyway. At least for me too.

Reply | Threaded
Open this post in threaded view
|

Bug#918430: find /tmp/ -path /tm<TAB>

Gabriel F. T. Gomes-4
In reply to this post by 積丹尼 Dan Jacobson