mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-21 02:47:01 +00:00
Improve handling of cmdline errors
This commit is contained in:
parent
c88282c0a1
commit
886e00e03f
1 changed files with 3 additions and 3 deletions
|
|
@ -49,13 +49,13 @@ func processResults(cancel context.CancelFunc, o output.Output, validationResult
|
||||||
func realMain() int {
|
func realMain() int {
|
||||||
cfg, out, err := config.FromFlags(os.Args[0], os.Args[1:])
|
cfg, out, err := config.FromFlags(os.Args[0], os.Args[1:])
|
||||||
if out != "" {
|
if out != "" {
|
||||||
out := os.Stderr
|
o := os.Stderr
|
||||||
errCode := 1
|
errCode := 1
|
||||||
if cfg.Help {
|
if cfg.Help {
|
||||||
out = os.Stdout
|
o = os.Stdout
|
||||||
errCode = 0
|
errCode = 0
|
||||||
}
|
}
|
||||||
fmt.Fprintln(out, out)
|
fmt.Fprintln(o, out)
|
||||||
return errCode
|
return errCode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue