mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
remove last mentions of flag in main
This commit is contained in:
parent
377b0ea466
commit
939b44e3ca
2 changed files with 5 additions and 4 deletions
|
|
@ -2,7 +2,6 @@ package main
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/xeipuuv/gojsonschema"
|
||||
"github.com/yannh/kubeconform/pkg/config"
|
||||
|
|
@ -183,9 +182,7 @@ func realMain() int {
|
|||
var err error
|
||||
|
||||
cfg := config.FromFlags()
|
||||
|
||||
if cfg.Help {
|
||||
flag.Usage()
|
||||
return 1
|
||||
}
|
||||
|
||||
|
|
@ -193,7 +190,7 @@ func realMain() int {
|
|||
stat, _ := os.Stdin.Stat()
|
||||
isStdin := (stat.Mode() & os.ModeCharDevice) == 0
|
||||
|
||||
if len(flag.Args()) == 1 && flag.Args()[0] == "-" {
|
||||
if len(cfg.Files) == 1 && cfg.Files[0] == "-" {
|
||||
isStdin = true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,5 +79,9 @@ func FromFlags() Config {
|
|||
c.Files = append(c.Files, file)
|
||||
}
|
||||
|
||||
if c.Help {
|
||||
flag.Usage()
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue