-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bash completion for -g glob #792
Comments
This sounds like a clap bug. Completion rules for ripgrep are provided on a best effort basis. Right now, the bash completion rules are automatically generated. I don't personally have the bandwidth to do anything more than that. (We either provide what clap provides, or someone else maintains them (like @okdana has been doing for zsh), or we drop them completely.) |
Thank you for the awesome bug report though. :-) |
Thank you for the incredible response time! |
@jzinn would you mind filing a bug at kbknapp/clap-rs please? In general the completion script generation was meant to get to the 95% solution, so they're not perfect. I agree it shouldn't replace anything already typed on the command line with a generic It should be fairly simple on my end to just remove all generic completions and simply use file completion which I would say is what people expect 99% of the time. Even when it's actually wrong and not what the flag is asking for, it still doesn't surprise people like totally erasing what they wrote and replacing with a generic statement. |
Certainly. |
This appears to have been fixed in clap. |
What version of ripgrep are you using?
Ripgrep:
Bash:
Bash-completion:
What operating system are you using ripgrep on?
Describe your question, feature request, or bug.
Bug:
rg -g Foo<tab>
should not be replaced withrg -g <GLOB>...
.When typing an argument to
-g
and hitting the tab character, then whatever you have typed for the argument is erased and replaced with the characters<GLOB>...
. It would be better not to do anything at all to preserve what was typed.Even better than doing nothing would be to use file names for completion, so ...
Feature request:
rg -g Foo<tab>
should use files in the current directory for tab auto-completion in Bash. If possible, it should also work with negation (rg -g "!"Foo<tab>
).For example, the following should work:
This should also work:
If this is a bug, what are the steps to reproduce the behavior?
Make a file:
Attempt to use it with autocomplete:
If this is a bug, what is the actual behavior?
The command line is changed to
If this is a bug, what is the expected behavior?
Either maintain the original command:
or use file name:
The text was updated successfully, but these errors were encountered: