Marc Khouzam

Results 311 comments of Marc Khouzam

Thanks @libozh https://github.com/spf13/cobra/blob/199b7abe121caf41a163289041b13b0ca2418a72/command.go#L1109-L1113 In the above code `c` is the root command while `cmd` is the sub-command being called. I interpret the line `if cmd.ctx == nil {` to say...

Hi @raphaelvigee. Fuzzy matching is already possible for `ValidArgsFunction` and `RegisterFlagCompletionFunc`. All that is required is for you not to filter on prefix. Helm does this for example: https://github.com/helm/helm/pull/10513. However,...

For fuzzy matching to work for `zsh` you need to set the `matcher-list` in `zstyle`. I get this automatically with `oh-my-zsh`. ``` $ zstyle | grep -A1 matcher-list matcher-list :completion:*...

> I am ok with the change but I wonder what the motivation is? Assuming that you will not remove the old script until a major version bump I don't...

> I do have this matcher in: I would expect your example to work with zsh in that case. > But i feel like we should be able to make...

> Same, but zsh does not seem to agree as per the logs in [#1828 (comment)](https://github.com/spf13/cobra/issues/1828#issuecomment-1283110025) In case it helps, you can at least verify what Cobra sends the shell...

> To try and move this forward, would it be acceptable to add a new directive to bypass the shell matching altogether ? If the final solution is more flexible...

Hi @IvanRibakov. Try using `subCmd.Flags().BoolVar()` instead of `subCmd.LocalFlags()`. I admit that I don't fully understand all these flag functions, but I use code I've seen work before.

Thanks @maxlandon for the detailed proposal. Cobra aims to provide the best user and developer experience and if carapace can help I’m open to discussing it. I don’t know much...