Skip to content

Commit

Permalink
Make the resources command more prominent (stripe#120)
Browse files Browse the repository at this point in the history
* Make the resources command more prominent

* Capitalize the resources list
  • Loading branch information
tomer-stripe authored and ob-stripe committed Aug 19, 2019
1 parent 24ef499 commit b421202
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func newResourcesCmd() *resourcesCmd {
rc.cmd = &cobra.Command{
Use: "resources",
Args: validators.NoArgs,
Short: "list namespace and resource subcommands",
Short: "List namespace and resource subcommands",
}
rc.cmd.SetHelpTemplate(getResourcesHelpTemplate())

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var rootCmd = &cobra.Command{
"listen": "webhooks",
"logs": "stripe",
"status": "stripe",
"resources": "help",
"resources": "resources",
},
Version: version.Version,
Short: "A CLI to help you integrate Stripe with your application",
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ func getUsageTemplate() string {
%s{{range $index, $cmd := .Commands}}{{if (eq (index $.Annotations $cmd.Name) "stripe")}}
{{rpad $cmd.Name $cmd.NamePadding }} {{$cmd.Short}}{{end}}{{end}}
%s{{range $index, $cmd := .Commands}}{{if (eq (index $.Annotations $cmd.Name) "resources")}}
{{rpad $cmd.Name $cmd.NamePadding }} {{$cmd.Short}}{{end}}{{end}}
%s{{range $index, $cmd := .Commands}}{{if (not (index $.Annotations $cmd.Name))}}
{{rpad $cmd.Name $cmd.NamePadding }} {{$cmd.Short}}{{end}}{{end}}{{else}}
Expand All @@ -65,10 +68,7 @@ func getUsageTemplate() string {
{{WrappedLocalFlagUsages . | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}
%s
{{WrappedInheritedFlagUsages . | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}}
%s{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}}
{{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}}
{{WrappedInheritedFlagUsages . | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableSubCommands}}
Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}}
`,
Expand All @@ -78,11 +78,11 @@ Use "{{.CommandPath}} [command] --help" for more information about a command.{{e
ansi.Bold("HTTP commands:"),
ansi.Bold("Webhook commands:"),
ansi.Bold("Stripe commands:"),
ansi.Bold("Resource commands:"),
ansi.Bold("Other commands:"),
ansi.Bold("Available commands:"),
ansi.Bold("Flags:"),
ansi.Bold("Global flags:"),
ansi.Bold("Additional help topics:"),
)
}

Expand Down

0 comments on commit b421202

Please sign in to comment.