mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
Fix usage of -h
This commit is contained in:
parent
19441d8182
commit
a5a34675c0
2 changed files with 9 additions and 1 deletions
|
|
@ -5,6 +5,12 @@ resetCacheFolder() {
|
|||
mkdir -p cache
|
||||
}
|
||||
|
||||
@test "Pass when displaying help with -h" {
|
||||
run bin/kubeconform -h
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${lines[0]}" == 'Usage: bin/kubeconform [OPTION]... [FILE OR FOLDER]...' ]
|
||||
}
|
||||
|
||||
@test "Pass when parsing a valid Kubernetes config YAML file" {
|
||||
run bin/kubeconform -summary fixtures/valid.yaml
|
||||
[ "$status" -eq 0 ]
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ func processResults(cancel context.CancelFunc, o output.Output, validationResult
|
|||
|
||||
func realMain() int {
|
||||
cfg, out, err := config.FromFlags(os.Args[0], os.Args[1:])
|
||||
if out != "" {
|
||||
if cfg.Help {
|
||||
return 0
|
||||
} else if out != "" {
|
||||
fmt.Println(out)
|
||||
return 1
|
||||
} else if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue