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

Add json flag for ctc_lib. #593

Merged
merged 6 commits into from
Apr 19, 2018
Merged

Conversation

tejal29
Copy link
Contributor

@tejal29 tejal29 commented Apr 17, 2018

No description provided.

@tejal29 tejal29 requested review from dlorenc and nkubala April 17, 2018 23:05
if displayError != nil {
Log.Errorf("%v", commandError)
}
if commandError != nil && displayError != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

change this to ||

@@ -74,6 +74,9 @@ func (ctb *ContainerToolCommandBase) AddSubCommands() {

// Set up Root Command
ctb.Command.SetHelpTemplate(HelpTemplate)

// Donot display usage when using RunE
ctb.SilenceUsage = true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add spf13/cobra#340 issue link to why we need to force this to be true.

LogIfErr(totalError, Log)

if commandError != nil && totalError != nil {
return errors.New("One or more errors")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are errors handled the same way if json output is used? It might be worth adding some test cases for failing commands as well in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will add tests in this PR :) Thanks @aaron-prindle.

Copy link
Collaborator

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

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

LGTM. Left one comment

@tejal29 tejal29 merged commit 35b035e into GoogleCloudPlatform:master Apr 19, 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.

2 participants