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

Update cobra to return non-zero exit codes upon non-runnable subcommands. #281

Merged
merged 2 commits into from Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -77,7 +77,7 @@ require (
github.com/shurcooL/go v0.0.0-20190704215121-7189cc372560 // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cobra v0.0.5
github.com/spf13/cobra v0.0.6-0.20190805155617-b80588d523ec
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.4.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Expand Up @@ -472,6 +472,8 @@ github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU
github.com/spf13/cobra v0.0.2/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v0.0.6-0.20190805155617-b80588d523ec h1:LYap2CbcbyqoJW/dAerxTbKxl+o3ZwE1R2J81rM9EkM=
github.com/spf13/cobra v0.0.6-0.20190805155617-b80588d523ec/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
Expand Down
4 changes: 2 additions & 2 deletions test/cli_test.go
Expand Up @@ -96,7 +96,7 @@ func (s *CLITestSuite) SetupSuite() {

func (s *CLITestSuite) Test_Confluent_Help() {
tests := []CLITest{
{name: "no args", fixture: "confluent-help-flag.golden"},
{name: "no args", fixture: "confluent-help-flag.golden", wantErrCode: 1},
{args: "help", fixture: "confluent-help.golden"},
{args: "--help", fixture: "confluent-help-flag.golden"},
{args: "version", fixture: "confluent-version.golden"},
Expand Down Expand Up @@ -200,7 +200,7 @@ func (s *CLITestSuite) Test_Confluent_Iam_Rolebinding_List() {

func (s *CLITestSuite) Test_Ccloud_Help() {
tests := []CLITest{
{name: "no args", fixture: "help-flag.golden"},
{name: "no args", fixture: "help-flag.golden", wantErrCode: 1},
{args: "help", fixture: "help.golden"},
{args: "--help", fixture: "help-flag.golden"},
{args: "version", fixture: "version.golden"},
Expand Down