mirror of https://github.com/databricks/cli.git
Added output template for list-secrets command (#1074)
## Changes Fixes #1067 ## Tests ``` andrew.nester@HFW9Y94129 cli % databricks secrets list-secrets "my-test-scope" --output text Key Last Updated Timestamp my-secret 1692805686489 my-test-secret 1692767910771 ```
This commit is contained in:
parent
6dd6899b52
commit
5526cd3fb2
|
@ -2,6 +2,7 @@ package secrets
|
|||
|
||||
import (
|
||||
"github.com/databricks/cli/libs/cmdio"
|
||||
"github.com/databricks/databricks-sdk-go/service/workspace"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
@ -16,7 +17,15 @@ func listScopesOverride(listScopesCmd *cobra.Command) {
|
|||
{{end}}`)
|
||||
}
|
||||
|
||||
func listSecretsOverride(listSecretsCommand *cobra.Command, _ *workspace.ListSecretsRequest) {
|
||||
listSecretsCommand.Annotations["template"] = cmdio.Heredoc(`
|
||||
{{header "Key"}} {{header "Last Updated Timestamp"}}
|
||||
{{range .}}{{.Key|green}} {{.LastUpdatedTimestamp}}
|
||||
{{end}}`)
|
||||
}
|
||||
|
||||
func init() {
|
||||
cmdOverrides = append(cmdOverrides, cmdOverride)
|
||||
listScopesOverrides = append(listScopesOverrides, listScopesOverride)
|
||||
listSecretsOverrides = append(listSecretsOverrides, listSecretsOverride)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue