Skip to content
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

cmd: silence usage text #449

Merged
merged 1 commit into from
May 24, 2018
Merged

Conversation

r2d4
Copy link
Contributor

@r2d4 r2d4 commented Apr 23, 2018

This supresses usage test from the output when we have an application error OR usage error. I can't find out a clear way to use cobra's arg validation and toggle this.
spf13/cobra#340

I'm a bit undecided about this. On one hand, we shouldn't output message error text on our application error, but on the other hand, for legitimate usage errors, the user needs to now run an additional skaffold --help

@r2d4
Copy link
Contributor Author

r2d4 commented Apr 23, 2018

fixes #447

Short: "A tool that facilitates continuous development for Kubernetes applications.",
Use: "skaffold",
Short: "A tool that facilitates continuous development for Kubernetes applications.",
SilenceUsage: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you move this line to PersistentPreRunE function, it will silent usage only after args are successfully checked.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or use https://github.com/GoogleCloudPlatform/runtimes-common/tree/master/ctc_lib
Where we silenceUsage Errors in initializers.

@dgageot
Copy link
Contributor

dgageot commented May 24, 2018

@r2d4 Do you think you can update your PR?

Copy link
Contributor

@dgageot dgageot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dgageot dgageot merged commit b1ee162 into GoogleContainerTools:master May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants