bash-completion icon indicating copy to clipboard operation
bash-completion copied to clipboard

Let find complete with directories after -path option

Open inconstante opened this issue 5 years ago • 2 comments

The argument to find's -path option is supposed to restrict the search results to items that belong to the specified directory, so let bash-completion suggest directories to it.

Reported by 積丹尼 Dan Jacobson [1].

[1] https://bugs.debian.org/918430

inconstante avatar Nov 03 '19 19:11 inconstante

Maybe that would be more inline with what other completions currently do, for instance, suggestion of perl modules after perl -M<TAB>.

On the other hand, I feel like that is re-implementing find itself. I do not feel like working on it, so I'll probably close this pull request.

Thanks for the feedback, Ville.

inconstante avatar Nov 08 '19 18:11 inconstante

If you don't mind, I'd appreciate leaving it open even though you may not be working on it yourself, I or someone will pick it up eventually and the issue won't be forgotten.

I don't think improving this is a matter of re-implementing find at all. Just examine the arguments given to see what is the starting-point arg, and filter all dir completions that don't start with it. Defaulting to the starting point would probably be just a matter of ${cur:=$starting_point}, grepping := gives some ideas.

scop avatar Nov 09 '19 07:11 scop