refactor: Remove unnecessary error discards from RegisterFlagCompletionFunc calls

This commit is contained in:
Denis Bilenko (aider) 2024-12-10 17:26:53 +01:00 committed by Denis Bilenko
parent 0832ccd136
commit ee67bb37e3
3 changed files with 5 additions and 5 deletions

View File

@ -146,7 +146,7 @@ func targetCompletion(cmd *cobra.Command, args []string, toComplete string) ([]s
func initTargetFlag(cmd *cobra.Command) {
// To operate in the context of a bundle, all commands must take an "target" parameter.
cmd.PersistentFlags().StringP("target", "t", "", "bundle target to use (if applicable)")
_ = cmd.RegisterFlagCompletionFunc("target", targetCompletion)
cmd.RegisterFlagCompletionFunc("target", targetCompletion)
}
// DEPRECATED flag

View File

@ -104,8 +104,8 @@ func initLogFlags(cmd *cobra.Command) *logFlags {
flags.MarkHidden("log-level")
flags.MarkHidden("log-format")
_ = cmd.RegisterFlagCompletionFunc("log-file", f.file.Complete)
_ = cmd.RegisterFlagCompletionFunc("log-level", f.level.Complete)
_ = cmd.RegisterFlagCompletionFunc("log-format", f.output.Complete)
cmd.RegisterFlagCompletionFunc("log-file", f.file.Complete)
cmd.RegisterFlagCompletionFunc("log-level", f.level.Complete)
cmd.RegisterFlagCompletionFunc("log-format", f.output.Complete)
return &f
}

View File

@ -65,6 +65,6 @@ 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")
_ = cmd.RegisterFlagCompletionFunc("progress-format", f.ProgressLogFormat.Complete)
cmd.RegisterFlagCompletionFunc("progress-format", f.ProgressLogFormat.Complete)
return &f
}