Wrap cli commands in backticks uniformly

This commit is contained in:
Yukai Chou 2023-11-10 15:07:34 +08:00
parent 17d336e005
commit 896101678f
11 changed files with 32 additions and 32 deletions

View file

@ -14,11 +14,11 @@ func NewCmdAlias(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "alias <command>",
Short: "Create command shortcuts",
Long: heredoc.Doc(`
Long: heredoc.Docf(`
Aliases can be used to make shortcuts for gh commands or to compose multiple commands.
Run "gh help alias set" to learn more.
`),
Run %[1]sgh help alias set%[1]s to learn more.
`, "`"),
}
cmdutil.DisableAuthCheck(cmd)

View file

@ -34,7 +34,7 @@ func NewCmdImport(f *cmdutil.Factory, runF func(*ImportOptions) error) *cobra.Co
cmd := &cobra.Command{
Use: "import [<filename> | -]",
Short: "Import aliases from a YAML file",
Long: heredoc.Doc(`
Long: heredoc.Docf(`
Import aliases from the contents of a YAML file.
Aliases should be defined as a map in YAML, where the keys represent aliases and
@ -49,10 +49,10 @@ func NewCmdImport(f *cmdutil.Factory, runF func(*ImportOptions) error) *cobra.Co
Use "-" to read aliases (in YAML format) from standard input.
The output from the gh command "alias list" can be used to produce a YAML file
The output from %[1]sgh alias list%[1]s can be used to produce a YAML file
containing your aliases, which you can use to import them from one machine to
another. Run "gh help alias list" to learn more.
`),
another. Run %[1]sgh help alias list%[1]s to learn more.
`, "`"),
Example: heredoc.Doc(`
# Import aliases from a file
$ gh alias import aliases.yml

View file

@ -109,13 +109,13 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {
word "installed" but otherwise the order and content of the columns
is the same.
This command behaves similarly to 'gh search repos' but does not
This command behaves similarly to %[1]sgh search repos%[1]s but does not
support as many search qualifiers. For a finer grained search of
extensions, try using:
gh search repos --topic "gh-extension"
and adding qualifiers as needed. See 'gh help search repos' to learn
and adding qualifiers as needed. See %[1]sgh help search repos%[1]s to learn
more about repository search.
For listing just the extensions that are already installed locally,
@ -449,7 +449,7 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {
gh ext search
along with gh ext install, gh ext remove, and gh repo view.
along with %[1]sgh ext install%[1]s, %[1]sgh ext remove%[1]s, and %[1]sgh repo view%[1]s.
`, "`"),
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {

View file

@ -40,15 +40,15 @@ func NewCmdClone(f *cmdutil.Factory, runF func(*CloneOptions) error) *cobra.Comm
Use: "clone <gist> [<directory>] [-- <gitflags>...]",
Args: cmdutil.MinimumArgs(1, "cannot clone: gist argument required"),
Short: "Clone a gist locally",
Long: heredoc.Doc(`
Long: heredoc.Docf(`
Clone a GitHub gist locally.
A gist can be supplied as argument in either of the following formats:
- by ID, e.g. 5b0e0062eb8e9654adad7bb1d81cc75f
- by URL, e.g. "https://gist.github.com/OWNER/5b0e0062eb8e9654adad7bb1d81cc75f"
Pass additional 'git clone' flags by listing them after '--'.
`),
Pass additional %[1]sgit clone%[1]s flags by listing them after '--'.
`, "`"),
RunE: func(cmd *cobra.Command, args []string) error {
opts.Gist = args[0]
opts.GitArgs = args[1:]

View file

@ -56,12 +56,12 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
cmd := &cobra.Command{
Use: "create",
Short: "Create a new issue",
Long: heredoc.Doc(`
Long: heredoc.Docf(`
Create an issue on GitHub.
Adding an issue to projects requires authorization with the "project" scope.
To authorize, run "gh auth refresh -s project".
`),
To authorize, run %[1]sgh auth refresh -s project%[1]s.
`, "`"),
Example: heredoc.Doc(`
$ gh issue create --title "I found a bug" --body "Nothing works"
$ gh issue create --label "bug,help wanted"

View file

@ -50,12 +50,12 @@ func NewCmdEdit(f *cmdutil.Factory, runF func(*EditOptions) error) *cobra.Comman
cmd := &cobra.Command{
Use: "edit {<numbers> | <urls>}",
Short: "Edit issues",
Long: heredoc.Doc(`
Long: heredoc.Docf(`
Edit one or more issues within the same repository.
Editing issues' projects requires authorization with the "project" scope.
To authorize, run "gh auth refresh -s project".
`),
To authorize, run %[1]sgh auth refresh -s project%[1]s.
`, "`"),
Example: heredoc.Doc(`
$ gh issue edit 23 --title "I found a bug" --body "Nothing works"
$ gh issue edit 23 --add-label "bug,help wanted" --remove-label "core"

View file

@ -119,7 +119,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
head branch of the pull request. Disable this with %[1]s--no-maintainer-edit%[1]s.
Adding a pull request to projects requires authorization with the "project" scope.
To authorize, run "gh auth refresh -s project".
To authorize, run %[1]sgh auth refresh -s project%[1]s.
`, "`"),
Example: heredoc.Doc(`
$ gh pr create --title "The bug is fixed" --body "Everything works again"

View file

@ -47,15 +47,15 @@ func NewCmdEdit(f *cmdutil.Factory, runF func(*EditOptions) error) *cobra.Comman
cmd := &cobra.Command{
Use: "edit [<number> | <url> | <branch>]",
Short: "Edit a pull request",
Long: heredoc.Doc(`
Long: heredoc.Docf(`
Edit a pull request.
Without an argument, the pull request that belongs to the current branch
is selected.
Editing a pull request's projects requires authorization with the "project" scope.
To authorize, run "gh auth refresh -s project".
`),
To authorize, run %[1]sgh auth refresh -s project%[1]s.
`, "`"),
Example: heredoc.Doc(`
$ gh pr edit 23 --title "I found a bug" --body "Nothing works"
$ gh pr edit 23 --add-label "bug,help wanted" --remove-label "core"

View file

@ -21,7 +21,7 @@ var HelpTopics = []helpTopic{
{
name: "mintty",
short: "Information about using gh with MinTTY",
long: heredoc.Doc(`
long: heredoc.Docf(`
MinTTY is the terminal emulator that comes by default with Git
for Windows. It has known issues with gh's ability to prompt a
user for input.
@ -31,12 +31,12 @@ var HelpTopics = []helpTopic{
- Reinstall Git for Windows, checking "Enable experimental support for pseudo consoles".
- Use a different terminal emulator with Git for Windows like Windows Terminal.
You can run "C:\Program Files\Git\bin\bash.exe" from any terminal emulator to continue
You can run %[1]sC:\Program Files\Git\bin\bash.exe%[1]s from any terminal emulator to continue
using all of the tooling in Git For Windows without MinTTY.
- Prefix invocations of gh with winpty, eg: "winpty gh auth login".
- Prefix invocations of gh with winpty, eg: %[1]swinpty gh auth login%[1]s.
NOTE: this can lead to some UI bugs.
`),
`, "`"),
},
{
name: "environment",
@ -99,7 +99,7 @@ var HelpTopics = []helpTopic{
GH_PATH: set the path to the gh executable, useful for when gh can not properly determine
its own path such as in the cygwin terminal.
`),
`, "`"),
},
{
name: "reference",

View file

@ -50,7 +50,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
Use the %[1]s--parents%[1]s flag to control whether rulesets configured at higher levels that also apply to the provided
repository or organization should be returned. The default is true.
Your access token must have the admin:org scope to use the %[1]s--org%[1]s flag, which can be granted by running "gh auth refresh -s admin:org".
Your access token must have the admin:org scope to use the %[1]s--org%[1]s flag, which can be granted by running %[1]sgh auth refresh -s admin:org%[1]s.
`, "`"),
Example: heredoc.Doc(`
# List rulesets in the current repository

View file

@ -13,10 +13,10 @@ func NewCmdVariable(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "variable <command>",
Short: "Manage GitHub Actions variables",
Long: heredoc.Doc(`
Long: heredoc.Docf(`
Variables can be set at the repository, environment or organization level for use in
GitHub Actions or Dependabot. Run "gh help variable set" to learn how to get started.
`),
GitHub Actions or Dependabot. Run %[1]sgh help variable set%[1]s to learn how to get started.
`, "`"),
}
cmdutil.EnableRepoOverride(cmd, f)