Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: adjust flags to options in cobra help and usage template #1188

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions api/utils/cobrautils/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ Aliases:
Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if and .HasAvailableLocalFlags .IsAvailableCommand}}

Flags:
Options:
{{ flagUsages .LocalFlags | trimTrailingWhitespaces}}{{end}}{{if and .HasAvailableInheritedFlags .IsAvailableCommand}}

Global Flags:
Global Options:
{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}

Description:
Expand Down Expand Up @@ -44,10 +44,10 @@ Examples:
Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}

Flags:
Options:
{{ flagUsages .LocalFlags | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}

Global Flags:
Global Options:
{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}}

Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}}
Expand Down
4 changes: 2 additions & 2 deletions cmds/cliplugin/cmds/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ ocm check rhubarb — Determine Whether We Are In Rhubarb Season
Synopsis:
ocm check rhubarb <options>

Flags:
Options:
-d, --date string the date to ask for (MM/DD)
-h, --help help for check

Expand All @@ -106,7 +106,7 @@ ocm check rhubarb — Determine Whether We Are In Rhubarb Season
Synopsis:
ocm check rhubarb <options>

Flags:
Options:
-d, --date string the date to ask for (MM/DD)
-h, --help help for check

Expand Down
8 changes: 4 additions & 4 deletions cmds/subcmdplugin/cmds/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Synopsis:
Available Commands:
demo a demo command

Flags:
Options:
-h, --help help for group

Description:
Expand All @@ -83,7 +83,7 @@ ocm group demo — A Demo Command
Synopsis:
ocm group demo <options> [flags]

Flags:
Options:
-h, --help help for demo
--version string some overloaded option

Expand All @@ -107,7 +107,7 @@ Synopsis:
Available Commands:
demo a demo command

Flags:
Options:
-h, --help help for group

Description:
Expand All @@ -126,7 +126,7 @@ ocm group demo — A Demo Command
Synopsis:
ocm group demo <options> [flags]

Flags:
Options:
-h, --help help for demo
--version string some overloaded option

Expand Down
Loading