Update help and fix heredoc indentation

This commit is contained in:
bagtoad 2024-10-09 21:41:54 -06:00
parent 282b3293c5
commit f07f49810a
5 changed files with 32 additions and 11 deletions

View file

@ -98,7 +98,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
For language or platform .gitignore templates to use with %[1]s--gitignore%[1]s, <https://github.com/github/gitignore>.
For license keywords to use with %[1]s--license%[1]s, <https://choosealicense.com/>.
For license keywords to use with %[1]s--license%[1]s, run %[1]sgh repo license list%[1]s or visit <https://choosealicense.com>.
`, "`"),
Example: heredoc.Doc(`
# create a repository interactively

View file

@ -27,7 +27,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
cmd := &cobra.Command{
Use: "list",
Short: "List gitignore templates used in creating repositories",
Short: "List available repository gitignore templates",
Aliases: []string{"ls"},
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {

View file

@ -33,10 +33,19 @@ func NewCmdView(f *cmdutil.Factory, runF func(*ViewOptions) error) *cobra.Comman
Use: "view <template>",
Short: "View an available repository gitignore template",
Long: heredoc.Docf(`
View an available repository %[1]s.gitignore%[1]s template.
%[1]s<template>%[1]s is a case-sensitive %[1]s.gitignore%[1]s template name.
View an available repository %[1]s.gitignore%[1]s template.
%[1]s<template>%[1]s is a case-sensitive %[1]s.gitignore%[1]s template name.
For a list of available templates, run %[1]sgh repo gitignore list%[1]s.
`, "`"),
Example: heredoc.Doc(`
# View the Go gitignore template
gh repo gitignore view Go
# View the Python gitignore template
gh repo gitignore view Python
`),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.Template = args[0]

View file

@ -30,9 +30,9 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
Use: "list",
Short: "List available repository license templates",
Long: heredoc.Doc(`
List available repository license templates.
Only the most commonly used licenses templates are returned. For even more licenses, visit <https://choosealicense.com/appendix>
List available repository license templates.
Only the most commonly used licenses templates are returned. For even more licenses, visit <https://choosealicense.com/appendix>
`),
Aliases: []string{"ls"},
Args: cobra.ExactArgs(0),

View file

@ -32,10 +32,22 @@ func NewCmdView(f *cmdutil.Factory, runF func(*ViewOptions) error) *cobra.Comman
Use: "view <license>",
Short: "View an available repository license template",
Long: heredoc.Docf(`
View an available repository license template.
%[1]s<license>%[1]s is a license name or SPDX ID.
View an available repository license template.
%[1]s<license>%[1]s can be a case-insensitive license name or SPDX ID.
Run %[1]sgh repo license list%[1]s to see available commonly used licenses. For even more licenses, visit <https://choosealicense.com/appendix>.
`, "`"),
Example: heredoc.Doc(`
# View the MIT license template
gh repo license view MIT
# View the GNU AGPL-3.0 license template
gh repo license view AGPL-3.0
# View the Apache-2.0 license template
gh repo license view Apache-2.0
`),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.License = args[0]