Skip to content

Commit 7b7fb86

Browse files
authored
Merge pull request #79 from mumoshu/suppress-unnecessary-command-usages
fix: Suppress unnecessary command usage when theres diff
2 parents 05029fe + 939d962 commit 7b7fb86

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

cmd/revision.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ func revisionCmd() *cobra.Command {
4747
expandTLSPaths()
4848
},
4949
RunE: func(cmd *cobra.Command, args []string) error {
50+
// Suppress the command usage on error. See #77 for more info
51+
cmd.SilenceUsage = true
52+
5053
if v, _ := cmd.Flags().GetBool("version"); v {
5154
fmt.Println(Version)
5255
return nil

cmd/rollback.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ func rollbackCmd() *cobra.Command {
3939
expandTLSPaths()
4040
},
4141
RunE: func(cmd *cobra.Command, args []string) error {
42+
// Suppress the command usage on error. See #77 for more info
43+
cmd.SilenceUsage = true
44+
4245
if v, _ := cmd.Flags().GetBool("version"); v {
4346
fmt.Println(Version)
4447
return nil

cmd/upgrade.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ func newChartCommand() *cobra.Command {
5050
expandTLSPaths()
5151
},
5252
RunE: func(cmd *cobra.Command, args []string) error {
53+
// Suppress the command usage on error. See #77 for more info
54+
cmd.SilenceUsage = true
5355

5456
if q, _ := cmd.Flags().GetBool("suppress-secrets"); q {
5557
diff.suppressedKinds = append(diff.suppressedKinds, "Secret")

0 commit comments

Comments
 (0)