refactor: clean up color output imports in list, root, and status files

Signed-off-by: Mohammadreza Asadollahifard <mazafard@gmail.com>
pull/31034/head
Mohammadreza Asadollahifard 2 months ago
parent d28343550f
commit c1b3a83514
No known key found for this signature in database
GPG Key ID: 89C260092433E3CC

@ -26,9 +26,9 @@ import (
"github.com/gosuri/uitable" "github.com/gosuri/uitable"
"github.com/spf13/cobra" "github.com/spf13/cobra"
coloroutput "helm.sh/helm/v4/internal/cli/output"
"helm.sh/helm/v4/pkg/action" "helm.sh/helm/v4/pkg/action"
"helm.sh/helm/v4/pkg/cli/output" "helm.sh/helm/v4/pkg/cli/output"
coloroutput "helm.sh/helm/v4/internal/cli/output"
"helm.sh/helm/v4/pkg/cmd/require" "helm.sh/helm/v4/pkg/cmd/require"
release "helm.sh/helm/v4/pkg/release/v1" release "helm.sh/helm/v4/pkg/release/v1"
) )

@ -177,7 +177,7 @@ func newRootCmdWithConfig(actionConfig *action.Configuration, out io.Writer, arg
flags.Parse(args) flags.Parse(args)
logSetup(settings.Debug) logSetup(settings.Debug)
// Validate color mode setting // Validate color mode setting
switch settings.ColorMode { switch settings.ColorMode {
case "never", "auto", "always": case "never", "auto", "always":
@ -185,7 +185,7 @@ func newRootCmdWithConfig(actionConfig *action.Configuration, out io.Writer, arg
default: default:
return nil, fmt.Errorf("invalid color mode %q: must be one of: never, auto, always", settings.ColorMode) return nil, fmt.Errorf("invalid color mode %q: must be one of: never, auto, always", settings.ColorMode)
} }
// Configure color output based on ColorMode setting // Configure color output based on ColorMode setting
configureColorOutput(settings) configureColorOutput(settings)
@ -193,7 +193,7 @@ func newRootCmdWithConfig(actionConfig *action.Configuration, out io.Writer, arg
_ = cmd.RegisterFlagCompletionFunc("color", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { _ = cmd.RegisterFlagCompletionFunc("color", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
return []string{"never", "auto", "always"}, cobra.ShellCompDirectiveNoFileComp return []string{"never", "auto", "always"}, cobra.ShellCompDirectiveNoFileComp
}) })
// Setup shell completion for the colour flag // Setup shell completion for the colour flag
_ = cmd.RegisterFlagCompletionFunc("colour", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { _ = cmd.RegisterFlagCompletionFunc("colour", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
return []string{"never", "auto", "always"}, cobra.ShellCompDirectiveNoFileComp return []string{"never", "auto", "always"}, cobra.ShellCompDirectiveNoFileComp

@ -28,10 +28,10 @@ import (
"k8s.io/kubectl/pkg/cmd/get" "k8s.io/kubectl/pkg/cmd/get"
coloroutput "helm.sh/helm/v4/internal/cli/output"
"helm.sh/helm/v4/pkg/action" "helm.sh/helm/v4/pkg/action"
chartutil "helm.sh/helm/v4/pkg/chart/v2/util" chartutil "helm.sh/helm/v4/pkg/chart/v2/util"
"helm.sh/helm/v4/pkg/cli/output" "helm.sh/helm/v4/pkg/cli/output"
coloroutput "helm.sh/helm/v4/internal/cli/output"
"helm.sh/helm/v4/pkg/cmd/require" "helm.sh/helm/v4/pkg/cmd/require"
release "helm.sh/helm/v4/pkg/release/v1" release "helm.sh/helm/v4/pkg/release/v1"
) )

Loading…
Cancel
Save