mirror of https://github.com/databricks/cli.git
refactor: Remove unnecessary error assignments from MarkHidden calls
This commit is contained in:
parent
e4352e8b59
commit
010ce1e5a9
|
@ -36,7 +36,7 @@ func newDeployCommand() *cobra.Command {
|
|||
_ = cmd.Flags().MarkDeprecated("compute-id", "use --cluster-id instead")
|
||||
cmd.Flags().BoolVar(&verbose, "verbose", false, "Enable verbose output.")
|
||||
// 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 {
|
||||
ctx := cmd.Context()
|
||||
|
|
|
@ -437,8 +437,8 @@ func NewGenerateDashboardCommand() *cobra.Command {
|
|||
// 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.existingID, "existing-dashboard-id", "", `ID of the dashboard to generate configuration for`)
|
||||
_ = cmd.Flags().MarkHidden("existing-dashboard-path")
|
||||
_ = cmd.Flags().MarkHidden("existing-dashboard-id")
|
||||
cmd.Flags().MarkHidden("existing-dashboard-path")
|
||||
cmd.Flags().MarkHidden("existing-dashboard-id")
|
||||
|
||||
// Output flags.
|
||||
cmd.Flags().StringVarP(&d.resourceDir, "resource-dir", "d", "./resources", `directory to write the configuration to`)
|
||||
|
|
|
@ -21,5 +21,5 @@ func (f *configureFlags) Register(cmd *cobra.Command) {
|
|||
// Include token flag for compatibility with the legacy CLI.
|
||||
// It doesn't actually do anything because we always use PATs.
|
||||
cmd.Flags().Bool("token", true, "Configure using Databricks Personal Access Token")
|
||||
_ = cmd.Flags().MarkHidden("token")
|
||||
cmd.Flags().MarkHidden("token")
|
||||
}
|
||||
|
|
|
@ -100,9 +100,9 @@ func initLogFlags(cmd *cobra.Command) *logFlags {
|
|||
flags.Var(&f.output, "log-format", "log output format (text or json)")
|
||||
|
||||
// mark fine-grained flags hidden from global --help
|
||||
_ = flags.MarkHidden("log-file")
|
||||
_ = flags.MarkHidden("log-level")
|
||||
_ = flags.MarkHidden("log-format")
|
||||
flags.MarkHidden("log-file")
|
||||
flags.MarkHidden("log-level")
|
||||
flags.MarkHidden("log-format")
|
||||
|
||||
_ = cmd.RegisterFlagCompletionFunc("log-file", f.file.Complete)
|
||||
_ = cmd.RegisterFlagCompletionFunc("log-level", f.level.Complete)
|
||||
|
|
|
@ -64,7 +64,7 @@ func initProgressLoggerFlag(cmd *cobra.Command, logFlags *logFlags) *progressLog
|
|||
|
||||
flags := cmd.PersistentFlags()
|
||||
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)
|
||||
return &f
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue