forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
check_cli_conventions.go
37 lines (30 loc) · 1.01 KB
/
check_cli_conventions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"fmt"
"os"
"github.com/openshift/origin/pkg/cmd/openshift"
cmdsanity "github.com/openshift/origin/tools/clicheck/sanity"
)
var (
skip = []string{
"openshift kube", // TODO enable when we upstream all these conventions
"openshift start kubernetes", // TODO enable when we upstream all these conventions
"openshift cli create quota", // TODO has examples starting with '//', enable when we upstream all these conventions
"openshift cli adm", // already checked in 'openshift admin'
"openshift cli ex", // we will only care about experimental when they get promoted
"openshift cli types",
}
)
func main() {
errors := []error{}
oc := openshift.NewCommandOpenShift("openshift")
result := cmdsanity.CheckCmdTree(oc, cmdsanity.AllCmdChecks, skip)
errors = append(errors, result...)
if len(errors) > 0 {
for i, err := range errors {
fmt.Fprintf(os.Stderr, "%d. %s\n\n", i+1, err)
}
os.Exit(1)
}
fmt.Fprintln(os.Stdout, "Congrats, CLI looks good!")
}