INNER CODE UNIT · Go

parseFlags

komodorio/helm-dashboard · main.go:110

func parseFlags() options {
	ns := os.Getenv("HELM_NAMESPACE")
	if ns == "default" { // it's how Helm passes to plugin the empty NS, we have to reset it back
		ns = ""
	}

	opts := options{Namespace: ns}
	args, err := flags.Parse(&opts)
	if err != nil {
		var e *flags.Error
		if errors.As(err, &e) {
			if e.Type == flags.ErrHelp {
				os.Exit(0)
			}
		}

		// we rely on default behavior to print the problem inside `flags` library
		os.Exit(1)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…