-
Notifications
You must be signed in to change notification settings - Fork 374
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
Inconsistent program name in --help message #521
Comments
Hi @ahmetb would love to help on this one ! |
After some researches I've found that we cannot change this behaviour. Here is the result with the
|
I think that makes the situation worse, and doesn't solve any of the existing occurrences. Isn't there a Name field? |
There's a field "Use" but if we enter a space in this field, it will only take the first name.
|
Hmm I suspect that might be a bug in cobra. (It would be good to follow up with them). Alternatively, we can consider nbsp character to prevent splitting, but it's hacky. |
Do you want me to try something with nbsp and place an issue to cobra repository ? |
Let's ask cobra repo first since this is not urgent. Maybe they have a solution. I also recommend looking at cobra code to see where/why the splitting happens. Maybe there's a way to disable it. |
Has anyone asked cobra yet? I worked up a little example that I think illustrates the problem from cobra's perspective: main.go
Default help for root command when running without a command:
Help for a specific command:
|
Don’t think anyone followed up in Hugo repo. If anyone has time to fix it in upstream, would be super appreciated. 💕 |
I'll take a look at it in the cobra repo and circle back once it is resolved to resolve this issue. /assign |
Cobra people are very reluctant to merge anything. I would not count on them suddenly merging a PR. See spf13/cobra#959. |
@corneliusweig I noticed they have a lot of unmerged PRs, so I guess you're probably right. I did open an issue and suggest a potential PR that would allow space to be preserved if it is escaped, but I won't get my hopes up. In the meantime, I will revisit the krew and kubectl code and see if there is a workaround. |
Yeah, I fear we have to handle this on our side. |
Its ok I actually think I found a way that cobra lets us customize the usage template.... working on it now to try it out. looks promising so far. |
I am hoping we don’t maintain a custom go template. But if we do, maybe we can simplify a few other things along the way. |
If the patch is trivial btw I might be able to get it merged. Just let me know. |
OK, let me know what you think. It's a little bit hack-y but not TOO bad 😄 |
…y 'kubectl krew' instead of just 'krew' See issue kubernetes-sigs#521 for more details: kubernetes-sigs#521
…y 'kubectl krew' instead of just 'krew' See issue kubernetes-sigs#521 for more details: kubernetes-sigs#521
…y 'kubectl krew' instead of just 'krew' See issue kubernetes-sigs#521 for more details
…y 'kubectl krew' instead of just 'krew' See issue kubernetes-sigs#521 for more details
See the end, it doesn't say
kubectl krew
The text was updated successfully, but these errors were encountered: