mirror of https://github.com/databricks/cli.git
Hide commands under preview from help output (#469)
## Changes TSIA Depends on https://github.com/databricks/databricks-sdk-go/pull/497. ## Tests Manually looked at the help output and no longer see the hidden commands.
This commit is contained in:
parent
63437a6a98
commit
96643fd746
|
@ -20,13 +20,18 @@ import (
|
||||||
{{define "service"}}
|
{{define "service"}}
|
||||||
var Cmd = &cobra.Command{
|
var Cmd = &cobra.Command{
|
||||||
Use: "{{(.TrimPrefix "account").KebabName}}",
|
Use: "{{(.TrimPrefix "account").KebabName}}",
|
||||||
{{if .Description -}}
|
{{- if .Description }}
|
||||||
Short: `{{.Summary | without "`"}}`,
|
Short: `{{.Summary | without "`"}}`,
|
||||||
Long: `{{.Comment " " 80 | without "`"}}`,
|
Long: `{{.Comment " " 80 | without "`"}}`,
|
||||||
{{- end }}
|
{{- end }}
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"package": "{{ .Package.Name }}",
|
"package": "{{ .Package.Name }}",
|
||||||
},
|
},
|
||||||
|
{{- if .IsPrivatePreview }}
|
||||||
|
|
||||||
|
// This service is being previewed; hide from help output.
|
||||||
|
Hidden: true,
|
||||||
|
{{- end }}
|
||||||
}
|
}
|
||||||
|
|
||||||
{{- $serviceName := .KebabName -}}
|
{{- $serviceName := .KebabName -}}
|
||||||
|
@ -79,10 +84,16 @@ func init() {
|
||||||
{{- $hasRequiredArgs := and (not $hasIdPrompt) $hasPosArgs -}}
|
{{- $hasRequiredArgs := and (not $hasIdPrompt) $hasPosArgs -}}
|
||||||
var {{.CamelName}}Cmd = &cobra.Command{
|
var {{.CamelName}}Cmd = &cobra.Command{
|
||||||
Use: "{{.KebabName}}{{if $hasPosArgs}}{{range .Request.RequiredFields}} {{.ConstantName}}{{end}}{{end}}",
|
Use: "{{.KebabName}}{{if $hasPosArgs}}{{range .Request.RequiredFields}} {{.ConstantName}}{{end}}{{end}}",
|
||||||
{{if .Description -}}
|
{{- if .Description }}
|
||||||
Short: `{{.Summary | without "`"}}`,
|
Short: `{{.Summary | without "`"}}`,
|
||||||
Long: `{{.Comment " " 80 | without "`"}}`,
|
Long: `{{.Comment " " 80 | without "`"}}`,
|
||||||
{{end}}
|
{{- end }}
|
||||||
|
{{- if .IsPrivatePreview }}
|
||||||
|
|
||||||
|
// This command is being previewed; hide from help output.
|
||||||
|
Hidden: true,
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
Annotations: map[string]string{},{{if $hasRequiredArgs }}
|
Annotations: map[string]string{},{{if $hasRequiredArgs }}
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
check := cobra.ExactArgs({{len .Request.RequiredFields}})
|
check := cobra.ExactArgs({{len .Request.RequiredFields}})
|
||||||
|
|
|
@ -21,6 +21,9 @@ var Cmd = &cobra.Command{
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"package": "iam",
|
"package": "iam",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// This service is being previewed; hide from help output.
|
||||||
|
Hidden: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// start get command
|
// start get command
|
||||||
|
|
|
@ -20,6 +20,9 @@ var Cmd = &cobra.Command{
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"package": "billing",
|
"package": "billing",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// This service is being previewed; hide from help output.
|
||||||
|
Hidden: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// start create command
|
// start create command
|
||||||
|
|
|
@ -29,6 +29,9 @@ var Cmd = &cobra.Command{
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"package": "catalog",
|
"package": "catalog",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// This service is being previewed; hide from help output.
|
||||||
|
Hidden: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// start create command
|
// start create command
|
||||||
|
|
|
@ -333,6 +333,9 @@ var maintenanceCmd = &cobra.Command{
|
||||||
|
|
||||||
Enables or disables auto maintenance on the metastore.`,
|
Enables or disables auto maintenance on the metastore.`,
|
||||||
|
|
||||||
|
// This command is being previewed; hide from help output.
|
||||||
|
Hidden: true,
|
||||||
|
|
||||||
Annotations: map[string]string{},
|
Annotations: map[string]string{},
|
||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
check := cobra.ExactArgs(2)
|
check := cobra.ExactArgs(2)
|
||||||
|
|
|
@ -19,6 +19,9 @@ var Cmd = &cobra.Command{
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"package": "catalog",
|
"package": "catalog",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// This service is being previewed; hide from help output.
|
||||||
|
Hidden: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// start disable command
|
// start disable command
|
||||||
|
|
|
@ -26,6 +26,9 @@ var Cmd = &cobra.Command{
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"package": "catalog",
|
"package": "catalog",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// This service is being previewed; hide from help output.
|
||||||
|
Hidden: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// start create command
|
// start create command
|
||||||
|
|
Loading…
Reference in New Issue