From ce04d9b846329ed4f2c59acb0e4248c6f4811975 Mon Sep 17 00:00:00 2001 From: Rita Zerrizuela Date: Fri, 2 Apr 2021 16:39:11 -0300 Subject: [PATCH] Use the resource template on `tenants` commands (#228) * Fix duplicated hint copy * Use resource template on `tenants` commands --- internal/cli/templates.go | 4 ++-- internal/cli/tenants.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/cli/templates.go b/internal/cli/templates.go index 72093300c..1a952b1d1 100644 --- a/internal/cli/templates.go +++ b/internal/cli/templates.go @@ -87,7 +87,7 @@ Before using the CLI, you'll need to login: func namespaceUsageTemplate() string { return fmt.Sprintf(`%s{{if .Runnable}} {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} - {{.CommandPath}} [parameters...]{{end}}{{if gt (len .Aliases) 0}} + {{.CommandPath}} [parameters...] [flags]{{end}}{{if gt (len .Aliases) 0}} %s {{.NameAndAliases}}{{end}}{{if .HasExample}} @@ -122,7 +122,7 @@ Use "{{.CommandPath}} [command] --help" for more information about a command.{{e func resourceUsageTemplate() string { return fmt.Sprintf(`%s{{if .Runnable}} {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} - {{.CommandPath}} [parameters...]{{end}}{{if gt (len .Aliases) 0}} + {{.CommandPath}} [parameters...] [flags]{{end}}{{if gt (len .Aliases) 0}} %s {{.NameAndAliases}}{{end}}{{if .HasExample}} diff --git a/internal/cli/tenants.go b/internal/cli/tenants.go index 4b1fb91d4..19af6b291 100644 --- a/internal/cli/tenants.go +++ b/internal/cli/tenants.go @@ -13,6 +13,7 @@ func tenantsCmd(cli *cli) *cobra.Command { Short: "Manage configured tenants", } + cmd.SetUsageTemplate(resourceUsageTemplate()) cmd.AddCommand(useTenantCmd(cli)) cmd.AddCommand(listTenantCmd(cli)) return cmd