Closed grymoire7 closed 1 year ago
I ran into that bug with the completion for garden cmd
as well. I believe this upstream issue is the root cause:
https://github.com/clap-rs/clap/issues/3022
garden cmd
is setup the same way as the reproducer in that issue.
When I ran into it I didn't realize that it might be working with --commands
so I'll have to give that a try.
If the upstream issues don't get traction then I might just end up manually writing the completions myself, but I've got hope that progress will be made. 🤞
I'll document this shortcoming for now and see if there's anything we can do on our side to deal with it.
https://github.com/clap-rs/clap/issues/3166 looks like it's the headline epic issue that's being used to drive the features forward. We'll have to keep an eye on that one as well.
I was able to come up with a workaround that should hold us over for now. It's not built-in (it requires an extra shell pipeline step) so I documented it and linked to the upstream issue from the documentation.
The fix is simple enough to apply, though. Hope that helps.
I believe I may have fixed the upstream issue in https://github.com/clap-rs/clap/pull/4612
This would be a great fix to have in place before this feature is released so I'm hoping the fix gets merged soon. Once it's merged we won't need our grep
workaround.
Errors are returned using tab completion for
cmd
when no--commands
option was provided togarden completion zsh
. Other command completions appear to work. Command completion forcmd
also appears to work without error after completions are generated with the--commands
option. Reproduction steps: