mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-23 03:37:01 +00:00
Added ignore-stdin
This commit is contained in:
parent
b10927a052
commit
142f7b29a8
2 changed files with 6 additions and 0 deletions
|
|
@ -74,6 +74,10 @@ func realMain() int {
|
||||||
if len(cfg.Files) == 1 && cfg.Files[0] == "-" {
|
if len(cfg.Files) == 1 && cfg.Files[0] == "-" {
|
||||||
isStdin = true
|
isStdin = true
|
||||||
}
|
}
|
||||||
|
// Ignore every data from stdin and check for files.
|
||||||
|
if cfg.IgnoreStdIn {
|
||||||
|
isStdin = false
|
||||||
|
}
|
||||||
|
|
||||||
var o output.Output
|
var o output.Output
|
||||||
if o, err = output.New(cfg.OutputFormat, cfg.Summary, isStdin, cfg.Verbose); err != nil {
|
if o, err = output.New(cfg.OutputFormat, cfg.Summary, isStdin, cfg.Verbose); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ type Config struct {
|
||||||
Verbose bool
|
Verbose bool
|
||||||
IgnoreMissingSchemas bool
|
IgnoreMissingSchemas bool
|
||||||
IgnoreFilenamePatterns []string
|
IgnoreFilenamePatterns []string
|
||||||
|
IgnoreStdIn bool
|
||||||
Help bool
|
Help bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,6 +69,7 @@ func FromFlags(progName string, args []string) (Config, string, error) {
|
||||||
flags.StringVar(&skipKindsCSV, "skip", "", "comma-separated list of kinds to ignore")
|
flags.StringVar(&skipKindsCSV, "skip", "", "comma-separated list of kinds to ignore")
|
||||||
flags.StringVar(&rejectKindsCSV, "reject", "", "comma-separated list of kinds to reject")
|
flags.StringVar(&rejectKindsCSV, "reject", "", "comma-separated list of kinds to reject")
|
||||||
flags.BoolVar(&c.ExitOnError, "exit-on-error", false, "immediately stop execution when the first error is encountered")
|
flags.BoolVar(&c.ExitOnError, "exit-on-error", false, "immediately stop execution when the first error is encountered")
|
||||||
|
flags.BoolVar(&c.IgnoreStdIn, "ignore-stdin", false, "ignores the stdin for the cli.")
|
||||||
flags.BoolVar(&c.IgnoreMissingSchemas, "ignore-missing-schemas", false, "skip files with missing schemas instead of failing")
|
flags.BoolVar(&c.IgnoreMissingSchemas, "ignore-missing-schemas", false, "skip files with missing schemas instead of failing")
|
||||||
flags.Var(&ignoreFilenamePatterns, "ignore-filename-pattern", "regular expression specifying paths to ignore (can be specified multiple times)")
|
flags.Var(&ignoreFilenamePatterns, "ignore-filename-pattern", "regular expression specifying paths to ignore (can be specified multiple times)")
|
||||||
flags.BoolVar(&c.Summary, "summary", false, "print a summary at the end")
|
flags.BoolVar(&c.Summary, "summary", false, "print a summary at the end")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue