cnoe-io / idpbuilder

Spin up a complete internal developer platform with only Docker required as a dependency.
https://cloud-native.slack.com/archives/C05TN9WFN5S
Apache License 2.0
200 stars 59 forks source link

prevent printing usages on error #457

Closed nabuskey closed 3 days ago

nabuskey commented 4 days ago

Set SilenceUsage: true, for commands to prevent usages from being printed every time an error occurs.

before:

idpbuilder get secrets
Error: getting kube config: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
Usage:
  idpbuilder get secrets [flags]

Flags:
  -h, --help   help for secrets

Global Flags:
      --color              Enable colored log messages.
  -l, --log-level string   Set the log verbosity. Supported values are: debug, info, warn, and error. (default "info")
  -o, --output string      Output format. json or yaml.
  -p, --packages strings   names of packages.

getting kube config: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

After:

idpbuilder get secrets
Error: getting kube config: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
getting kube config: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

fixes: #439

nabuskey commented 3 days ago

Yeah we should definitely look into why errors are being printed twice.