From 6235657a7130418fe07200c0169ace5aaed247b0 Mon Sep 17 00:00:00 2001 From: Miki Pokryvailo Date: Sun, 8 Sep 2019 21:30:15 -0700 Subject: [PATCH] Update cobra to return non-zero exit codes upon non-runnable subcommands. (#281) * Update cobra to return non-zero exit codes upon non-runnable subcommands. * Fix breaking integration tests. --- go.mod | 2 +- go.sum | 2 ++ test/cli_test.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b0e98aea01..ef19dcaf5f 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index cf8ee83d89..52278a86dc 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/test/cli_test.go b/test/cli_test.go index 32e7c5930e..9c5c630e8e 100644 --- a/test/cli_test.go +++ b/test/cli_test.go @@ -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"}, @@ -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"},