Skip to content

Commit

Permalink
Silence Errors from Cobra Execution
Browse files Browse the repository at this point in the history
Previously, Cobra was printing non-formatted errors. However, we
already log these errors via zap. This fix silences Cobra from printing
redundant logs.
  • Loading branch information
gcs278 committed Jul 25, 2024
1 parent a178c7b commit 1aac18e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ var args = config.Flags{}

func main() {
cmd := cobra.Command{
Use: "crd-ref-docs",
Short: "Generate CRD reference documentation",
SilenceUsage: true,
Version: version(),
RunE: doRun,
Use: "crd-ref-docs",
Short: "Generate CRD reference documentation",
SilenceUsage: true,
SilenceErrors: true,
Version: version(),
RunE: doRun,
}

cmd.SetVersionTemplate("{{ .Version }}\n")
Expand Down

0 comments on commit 1aac18e

Please sign in to comment.