Skip to content

Commit

Permalink
Use the resource template on tenants commands (#228)
Browse files Browse the repository at this point in the history
* Fix duplicated hint copy

* Use resource template on `tenants` commands
  • Loading branch information
Widcket authored Apr 2, 2021
1 parent bb52349 commit ce04d9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/cli/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}} <resource> <operation> [parameters...]{{end}}{{if gt (len .Aliases) 0}}
{{.CommandPath}} <resource> <operation> [parameters...] [flags]{{end}}{{if gt (len .Aliases) 0}}
%s
{{.NameAndAliases}}{{end}}{{if .HasExample}}
Expand Down Expand Up @@ -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}} <operation> [parameters...]{{end}}{{if gt (len .Aliases) 0}}
{{.CommandPath}} <operation> [parameters...] [flags]{{end}}{{if gt (len .Aliases) 0}}
%s
{{.NameAndAliases}}{{end}}{{if .HasExample}}
Expand Down
1 change: 1 addition & 0 deletions internal/cli/tenants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ce04d9b

Please sign in to comment.