refactor: Remove unnecessary error assignments from MarkHidden calls

This commit is contained in:
Denis Bilenko (aider) 2024-12-10 17:22:22 +01:00 committed by Denis Bilenko
parent e4352e8b59
commit 010ce1e5a9
5 changed files with 8 additions and 8 deletions

View File

@ -36,7 +36,7 @@ func newDeployCommand() *cobra.Command {
_ = cmd.Flags().MarkDeprecated("compute-id", "use --cluster-id instead") _ = cmd.Flags().MarkDeprecated("compute-id", "use --cluster-id instead")
cmd.Flags().BoolVar(&verbose, "verbose", false, "Enable verbose output.") cmd.Flags().BoolVar(&verbose, "verbose", false, "Enable verbose output.")
// Verbose flag currently only affects file sync output, it's used by the vscode extension // Verbose flag currently only affects file sync output, it's used by the vscode extension
cmd.Flags().MarkHidden("verbose") _ = cmd.Flags().MarkHidden("verbose")
cmd.RunE = func(cmd *cobra.Command, args []string) error { cmd.RunE = func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context() ctx := cmd.Context()

View File

@ -437,8 +437,8 @@ func NewGenerateDashboardCommand() *cobra.Command {
// Included for symmetry with the other generate commands, but we prefer the shorter flags. // Included for symmetry with the other generate commands, but we prefer the shorter flags.
cmd.Flags().StringVar(&d.existingPath, "existing-dashboard-path", "", `workspace path of the dashboard to generate configuration for`) cmd.Flags().StringVar(&d.existingPath, "existing-dashboard-path", "", `workspace path of the dashboard to generate configuration for`)
cmd.Flags().StringVar(&d.existingID, "existing-dashboard-id", "", `ID of the dashboard to generate configuration for`) cmd.Flags().StringVar(&d.existingID, "existing-dashboard-id", "", `ID of the dashboard to generate configuration for`)
_ = cmd.Flags().MarkHidden("existing-dashboard-path") cmd.Flags().MarkHidden("existing-dashboard-path")
_ = cmd.Flags().MarkHidden("existing-dashboard-id") cmd.Flags().MarkHidden("existing-dashboard-id")
// Output flags. // Output flags.
cmd.Flags().StringVarP(&d.resourceDir, "resource-dir", "d", "./resources", `directory to write the configuration to`) cmd.Flags().StringVarP(&d.resourceDir, "resource-dir", "d", "./resources", `directory to write the configuration to`)

View File

@ -21,5 +21,5 @@ func (f *configureFlags) Register(cmd *cobra.Command) {
// Include token flag for compatibility with the legacy CLI. // Include token flag for compatibility with the legacy CLI.
// It doesn't actually do anything because we always use PATs. // It doesn't actually do anything because we always use PATs.
cmd.Flags().Bool("token", true, "Configure using Databricks Personal Access Token") cmd.Flags().Bool("token", true, "Configure using Databricks Personal Access Token")
_ = cmd.Flags().MarkHidden("token") cmd.Flags().MarkHidden("token")
} }

View File

@ -100,9 +100,9 @@ func initLogFlags(cmd *cobra.Command) *logFlags {
flags.Var(&f.output, "log-format", "log output format (text or json)") flags.Var(&f.output, "log-format", "log output format (text or json)")
// mark fine-grained flags hidden from global --help // mark fine-grained flags hidden from global --help
_ = flags.MarkHidden("log-file") flags.MarkHidden("log-file")
_ = flags.MarkHidden("log-level") flags.MarkHidden("log-level")
_ = flags.MarkHidden("log-format") flags.MarkHidden("log-format")
_ = cmd.RegisterFlagCompletionFunc("log-file", f.file.Complete) _ = cmd.RegisterFlagCompletionFunc("log-file", f.file.Complete)
_ = cmd.RegisterFlagCompletionFunc("log-level", f.level.Complete) _ = cmd.RegisterFlagCompletionFunc("log-level", f.level.Complete)

View File

@ -64,7 +64,7 @@ func initProgressLoggerFlag(cmd *cobra.Command, logFlags *logFlags) *progressLog
flags := cmd.PersistentFlags() flags := cmd.PersistentFlags()
flags.Var(&f.ProgressLogFormat, "progress-format", "format for progress logs (append, inplace, json)") flags.Var(&f.ProgressLogFormat, "progress-format", "format for progress logs (append, inplace, json)")
_ = flags.MarkHidden("progress-format") flags.MarkHidden("progress-format")
_ = cmd.RegisterFlagCompletionFunc("progress-format", f.ProgressLogFormat.Complete) _ = cmd.RegisterFlagCompletionFunc("progress-format", f.ProgressLogFormat.Complete)
return &f return &f
} }