func main() { if len(os.Getenv("GOMAXPROCS")) == 0 { runtime.GOMAXPROCS(runtime.NumCPU()) } cmd := cmd.KmsNew(os.Stdout) if err := cmd.Execute(); err != nil { os.Exit(1) } }
func main() { // use os.Args instead of "flags" because "flags" will mess up the man pages! path := "completions/bash/" if len(os.Args) == 2 { path = os.Args[1] } else if len(os.Args) > 2 { fmt.Fprintf(os.Stderr, "usage: %s [output directory]\n", os.Args[0]) os.Exit(1) } outDir, err := OutDir(path) if err != nil { fmt.Fprintf(os.Stderr, "failed to get output directory: %v\n", err) os.Exit(1) } outFile_kubernetes_manifest_scanner := outDir + "kuberenetes-manifest-scanner" kubernetes_manifest_scanner := cmd.KmsNew(ioutil.Discard) kubernetes_manifest_scanner.GenBashCompletionFile(outFile_kubernetes_manifest_scanner) }