refactor: Simplify flag deprecation and completion registration

This commit is contained in:
Denis Bilenko 2024-12-10 17:26:48 +01:00
parent 010ce1e5a9
commit 0832ccd136
1 changed files with 2 additions and 2 deletions

View File

@ -153,6 +153,6 @@ func initTargetFlag(cmd *cobra.Command) {
func initEnvironmentFlag(cmd *cobra.Command) { func initEnvironmentFlag(cmd *cobra.Command) {
// To operate in the context of a bundle, all commands must take an "environment" parameter. // To operate in the context of a bundle, all commands must take an "environment" parameter.
cmd.PersistentFlags().StringP("environment", "e", "", "bundle target to use (if applicable)") cmd.PersistentFlags().StringP("environment", "e", "", "bundle target to use (if applicable)")
_ = cmd.PersistentFlags().MarkDeprecated("environment", "use --target flag instead") cmd.PersistentFlags().MarkDeprecated("environment", "use --target flag instead")
_ = cmd.RegisterFlagCompletionFunc("environment", targetCompletion) cmd.RegisterFlagCompletionFunc("environment", targetCompletion)
} }