mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-22 19:27:01 +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
|
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" {
|
@test "Pass when parsing a valid Kubernetes config YAML file" {
|
||||||
run bin/kubeconform -summary fixtures/valid.yaml
|
run bin/kubeconform -summary fixtures/valid.yaml
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,9 @@ 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 cfg.Help {
|
||||||
|
return 0
|
||||||
|
} else if out != "" {
|
||||||
fmt.Println(out)
|
fmt.Println(out)
|
||||||
return 1
|
return 1
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue