-
Notifications
You must be signed in to change notification settings - Fork 252
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
Update Cobra to v1.5.0 #747
Conversation
See release notes: https://github.com/spf13/cobra/releases/tag/v1.5.0 Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
I find this error message more confusing than before the patch, unfortunately it cannot be customized: https://github.com/spf13/cobra/blob/5f2ec3c897155c3346e77430932e3966e5cfa648/flag_groups.go#L160. Let's see what other people think. Also side question: aren't |
I agree with Alex that the previous error message is more distinct and easier to read. As long as the message cannot be customized, I think we should stick to the old way of checking mutually exclusive flags. |
02737ba
to
dd94141
Compare
Indeed. I added a commit to handle this case. As hinted in the PR description, I also agree that the new error message is not very clear nor succinct. I removed the commit that switched to using new flag groups. |
Suggested-by: Alexandre Perrin <alex@isovalent.com> Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
dd94141
to
8316926
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Cobra v1.5.0 is now released and with it comes a new API called flag groups that allows to mark flags as mutually exclusive or required together.
This PR gives it a gobut other than saving a couple of lines of code, I'm not convince by the change from a user perspective.Current output:
With this patch:
Note that this new Cobra release also brings another new feature called active help. I'm not yet sure how it'd be best used in the context of the Hubble CLI.
EDIT: I ended up not opting for the new flag groups feature and removed the commit.