Repository: helm/helm
File: pkg/cmd/flags.go (Go)

Code before:
	"helm.sh/helm/v4/pkg/helmpath"
	"helm.sh/helm/v4/pkg/kube"
	"helm.sh/helm/v4/pkg/postrenderer"
	"helm.sh/helm/v4/pkg/repo/v1"
)

const (
	outputFlag         = "output"
	postRenderFlag     = "post-renderer"
	postRenderArgsFlag = "post-renderer-args"
)

func addValueOptionsFlags(f *pflag.FlagSet, v *values.Options) {
	f.StringSliceVarP(&v.ValueFiles, "values", "f", []string{}, "specify values in a YAML file or a URL (can specify multiple)")
	f.StringArrayVar(&v.Values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
	f.StringArrayVar(&v.StringValues, "set-string", []string{}, "set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
	f.StringArrayVar(&v.FileValues, "set-file", []string{}, "set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)")
	f.StringArrayVar(&v.JSONValues, "set-json", []string{}, "set JSON values on the command line (can specify multiple or separate values with commas: key1=jsonval1,key2=jsonval2 or using json format: {\"key1\": jsonval1, \"key2\": \"jsonval2\"})")
	f.StringArrayVar(&v.LiteralValues, "set-literal", []string{}, "set a literal STRING value on the command line")
}

func AddWaitFlag(cmd *cobra.Command, wait *kube.WaitStrategy) {
	cmd.Flags().Var(
		newWaitValue(kube.HookOnlyStrategy, wait),
		"wait",
		"wait until resources are ready (up to --timeout). Values: 'watcher' (default), 'legacy'. '--wait' without value = 'watcher'. Booleans deprecated; '--wait=false' does hook-only.",
	)
	// Sets the strategy to use the watcher strategy if `--wait` is used without an argument
	cmd.Flags().Lookup("wait").NoOptDefVal = string(kube.StatusWatcherStrategy)
}

type waitValue kube.WaitStrategy

func newWaitValue(defaultValue kube.WaitStrategy, ws *kube.WaitStrategy) *waitValue {
	*ws = defaultValue
	return (*waitValue)(ws)
}

func (ws *waitValue) String() string {
	if ws == nil {
		return ""
	}
	return string(*ws)
}

func (ws *waitValue) Set(s string) error {
	switch s {
	case string(kube.StatusWatcherStrategy), string(kube.LegacyStrategy):
		*ws = waitValue(s)
		return nil
	case "true":

Review comment (suggestion):
```suggestion
		"wait until resources are ready (up to --timeout). Values: 'watcher' (default), 'legacy', and 'hookOnly'",
```

I think don't document the deprecated boolean values. And no need to repeat the default details. But we should document `hookOnly`.

Code after:
	"helm.sh/helm/v4/pkg/helmpath"
	"helm.sh/helm/v4/pkg/kube"
	"helm.sh/helm/v4/pkg/postrenderer"
	"helm.sh/helm/v4/pkg/repo/v1"
)

const (
	outputFlag         = "output"
	postRenderFlag     = "post-renderer"
	postRenderArgsFlag = "post-renderer-args"
)

func addValueOptionsFlags(f *pflag.FlagSet, v *values.Options) {
	f.StringSliceVarP(&v.ValueFiles, "values", "f", []string{}, "specify values in a YAML file or a URL (can specify multiple)")
	f.StringArrayVar(&v.Values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
	f.StringArrayVar(&v.StringValues, "set-string", []string{}, "set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
	f.StringArrayVar(&v.FileValues, "set-file", []string{}, "set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)")
	f.StringArrayVar(&v.JSONValues, "set-json", []string{}, "set JSON values on the command line (can specify multiple or separate values with commas: key1=jsonval1,key2=jsonval2 or using json format: {\"key1\": jsonval1, \"key2\": \"jsonval2\"})")
	f.StringArrayVar(&v.LiteralValues, "set-literal", []string{}, "set a literal STRING value on the command line")
}

func AddWaitFlag(cmd *cobra.Command, wait *kube.WaitStrategy) {
	cmd.Flags().Var(
		newWaitValue(kube.HookOnlyStrategy, wait),
		"wait",
		"if specified, wait until resources are ready (up to --timeout). Values: 'watcher' (default), 'hookOnly', and 'legacy'.",
	)
	// Sets the strategy to use the watcher strategy if `--wait` is used without an argument
	cmd.Flags().Lookup("wait").NoOptDefVal = string(kube.StatusWatcherStrategy)
}

type waitValue kube.WaitStrategy

func newWaitValue(defaultValue kube.WaitStrategy, ws *kube.WaitStrategy) *waitValue {
	*ws = defaultValue
	return (*waitValue)(ws)
}

func (ws *waitValue) String() string {
	if ws == nil {
		return ""
	}
	return string(*ws)
}

func (ws *waitValue) Set(s string) error {
	switch s {
	case string(kube.StatusWatcherStrategy), string(kube.LegacyStrategy), string(kube.HookOnlyStrategy):
		*ws = waitValue(s)
		return nil
	case "true":