-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fish completions don't include filepaths unless a subcommand is first given #39
Comments
Thanks for the report! For reference, the completions get generated by Line 24 in 75ea37e
I think I'm specifying subcommands correctly here: Line 114 in 75ea37e
When I try it on my machine with nushell, it seems to work correctly: touch mini
# rip mi <tab>
rip mini So could be an issue in the clap completions generated for fish? |
Some related issues:
|
Might be worth reporting it in the clap repo? I'm not sure if they are aware of this issue. But I don't think I can fix on rip side, it will need to be fixed upstream (unless I'm using clap complete wrong). |
I had some time to play around with this, the completion that's generated includes complete -c rip -n __fish_use_subcommand -f -a completions -d 'Generate shell completions file'
complete -c rip -n __fish_use_subcommand -f -a graveyard -d 'Print the graveyard path'
complete -c rip -n __fish_use_subcommand -f -a help -d 'Print this message or the help of the given subcommand(s)' Removing those solves it, though like you said this is clearly upstream - I am just not confident enough right this moment to open an issue in that repo since I don't really know rust (and there looks to be a lot of potentially related fish issues). But I understand if you want to close this, I made a temp fix https://github.com/mawdac/fish-rip for anyone else who wants a temp workaround. Thanks for the feedback! |
Awesome! I think it would be very appreciated by the clap team if you post an issue pointing it out. Even if someone has already posted a related issue, better safe than sorry :) If I was the maintainer I would definitely want to know about this! |
You can always post a blank issue: https://github.com/clap-rs/clap/issues/new (as a maintainer myself, sometimes even if people post an issue without any details, it can make me realise something about the code that is buggy) I think you can just say exactly what you told me and copy-paste my responses and link this thread |
Good call, submitted! Feel free to do what you'd like with this issue 😄 thanks again for the help! |
I'm agree that the generated completion should not ignore files. But if there is a file name |
Good question. Maybe we could have an error message that the user should write it as I think most of the time people just don't worry about this since it's rare enough. For example, you can technically (By the way, |
Thanks for the upstream fix @tesuji! |
The completions for fish (haven't tested any others yet) only allow you to complete subcommands or options and not files/folders without first specifying a subcommand. This is pretty inconvenient for general
rip
usageEx.
I haven't dug into the completions but I imagine it would be a little tricky given they're generated from another lib it appears, haven't looked too deep - just wanted to report it. I get around it using
fzf
to pick things.The text was updated successfully, but these errors were encountered: