mirror of https://github.com/databricks/cli.git
refactor: Simplify flag deprecation and completion registration
This commit is contained in:
parent
010ce1e5a9
commit
0832ccd136
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue