mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-22 11:17:01 +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 (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"flag"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/xeipuuv/gojsonschema"
|
"github.com/xeipuuv/gojsonschema"
|
||||||
"github.com/yannh/kubeconform/pkg/config"
|
"github.com/yannh/kubeconform/pkg/config"
|
||||||
|
|
@ -183,9 +182,7 @@ func realMain() int {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
cfg := config.FromFlags()
|
cfg := config.FromFlags()
|
||||||
|
|
||||||
if cfg.Help {
|
if cfg.Help {
|
||||||
flag.Usage()
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -193,7 +190,7 @@ func realMain() int {
|
||||||
stat, _ := os.Stdin.Stat()
|
stat, _ := os.Stdin.Stat()
|
||||||
isStdin := (stat.Mode() & os.ModeCharDevice) == 0
|
isStdin := (stat.Mode() & os.ModeCharDevice) == 0
|
||||||
|
|
||||||
if len(flag.Args()) == 1 && flag.Args()[0] == "-" {
|
if len(cfg.Files) == 1 && cfg.Files[0] == "-" {
|
||||||
isStdin = true
|
isStdin = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,5 +79,9 @@ func FromFlags() Config {
|
||||||
c.Files = append(c.Files, file)
|
c.Files = append(c.Files, file)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.Help {
|
||||||
|
flag.Usage()
|
||||||
|
}
|
||||||
|
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue