mirror of https://github.com/databricks/cli.git
Configure cobra.NoArgs for bundle commands where applicable (#1250)
## Changes Return an error if unused arguments are passed to these commands. ## Tests n/a
This commit is contained in:
parent
d12f88e24d
commit
e1407038d3
|
@ -13,6 +13,7 @@ func newDeployCommand() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "deploy",
|
Use: "deploy",
|
||||||
Short: "Deploy bundle",
|
Short: "Deploy bundle",
|
||||||
|
Args: cobra.NoArgs,
|
||||||
PreRunE: utils.ConfigureBundleWithVariables,
|
PreRunE: utils.ConfigureBundleWithVariables,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@ import (
|
||||||
|
|
||||||
func newDestroyCommand() *cobra.Command {
|
func newDestroyCommand() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "destroy",
|
Use: "destroy",
|
||||||
Short: "Destroy deployed bundle resources",
|
Short: "Destroy deployed bundle resources",
|
||||||
|
Args: cobra.NoArgs,
|
||||||
PreRunE: utils.ConfigureBundleWithVariables,
|
PreRunE: utils.ConfigureBundleWithVariables,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,8 @@ import (
|
||||||
|
|
||||||
func newRunCommand() *cobra.Command {
|
func newRunCommand() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "run [flags] KEY",
|
Use: "run [flags] KEY",
|
||||||
Short: "Run a resource (e.g. a job or a pipeline)",
|
Short: "Run a resource (e.g. a job or a pipeline)",
|
||||||
|
|
||||||
Args: cobra.MaximumNArgs(1),
|
Args: cobra.MaximumNArgs(1),
|
||||||
PreRunE: utils.ConfigureBundleWithVariables,
|
PreRunE: utils.ConfigureBundleWithVariables,
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ func newSchemaCommand() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "schema",
|
Use: "schema",
|
||||||
Short: "Generate JSON Schema for bundle configuration",
|
Short: "Generate JSON Schema for bundle configuration",
|
||||||
|
Args: cobra.NoArgs,
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
||||||
|
|
|
@ -18,9 +18,9 @@ import (
|
||||||
|
|
||||||
func newSummaryCommand() *cobra.Command {
|
func newSummaryCommand() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "summary",
|
Use: "summary",
|
||||||
Short: "Describe the bundle resources and their deployment states",
|
Short: "Describe the bundle resources and their deployment states",
|
||||||
|
Args: cobra.NoArgs,
|
||||||
PreRunE: utils.ConfigureBundleWithVariables,
|
PreRunE: utils.ConfigureBundleWithVariables,
|
||||||
|
|
||||||
// This command is currently intended for the Databricks VSCode extension only
|
// This command is currently intended for the Databricks VSCode extension only
|
||||||
|
|
|
@ -12,9 +12,9 @@ import (
|
||||||
|
|
||||||
func newValidateCommand() *cobra.Command {
|
func newValidateCommand() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "validate",
|
Use: "validate",
|
||||||
Short: "Validate configuration",
|
Short: "Validate configuration",
|
||||||
|
Args: cobra.NoArgs,
|
||||||
PreRunE: utils.ConfigureBundleWithVariables,
|
PreRunE: utils.ConfigureBundleWithVariables,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue