Additional formatting changes

- gh help actions
  - highlight 3 commands to run for more information
- gh extension
  - wrapping url for online linking
  - fix install subcommand missing backtick formatting
- gh release create
  - fixing mixed indenting causing usage misalignment
- root help
  - backtick wrap help command for more info for consistency
- gh help environment
  - backtick wrap missed OWNER/REPO
- gh variable
  - brought consistency to output when deleting or setting variable
This commit is contained in:
Andy Feller 2023-12-01 09:08:51 -05:00
parent 21e9ba3345
commit b77de0d458
7 changed files with 19 additions and 19 deletions

View file

@ -29,33 +29,33 @@ func actionsExplainer(cs *iostreams.ColorScheme) string {
cacheHeader := cs.Bold("Interacting with the GitHub Actions cache")
return heredoc.Docf(`
%s
%[2]s
GitHub CLI integrates with GitHub Actions to help you manage runs and workflows.
%s
%[3]s
gh run list: List recent workflow runs
gh run view: View details for a workflow run or one of its jobs
gh run watch: Watch a workflow run while it executes
gh run rerun: Rerun a failed workflow run
gh run download: Download artifacts generated by runs
To see more help, run 'gh help run <subcommand>'
To see more help, run %[1]sgh help run <subcommand>%[1]s
%s
%[4]s
gh workflow list: List workflow files in your repository
gh workflow view: View details for a workflow file
gh workflow enable: Enable a workflow file
gh workflow disable: Disable a workflow file
gh workflow run: Trigger a workflow_dispatch run for a workflow file
To see more help, run 'gh help workflow <subcommand>'
To see more help, run %[1]sgh help workflow <subcommand>%[1]s
%s
%[5]s
gh cache list: List all the caches saved in GitHub Actions for a repository
gh cache delete: Delete one or all saved caches in GitHub Actions for a repository
To see more help, run 'gh help cache <subcommand>'
To see more help, run %[1]sgh help cache <subcommand>%[1]s
`, header, runHeader, workflowHeader, cacheHeader)
`, "`", header, runHeader, workflowHeader, cacheHeader)
}

View file

@ -45,7 +45,7 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {
An extension cannot override any of the core gh commands. If an extension name conflicts
with a core gh command, you can use %[1]sgh extension exec <extname>%[1]s.
See the list of available extensions at <https://github.com/topics/gh-extension>.
For the list of available extensions, see <https://github.com/topics/gh-extension>.
`, "`"),
Aliases: []string{"extensions", "ext"},
}
@ -297,7 +297,7 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "install <repository>",
Short: "Install a gh extension from a repository",
Long: heredoc.Doc(`
Long: heredoc.Docf(`
Install a GitHub repository locally as a GitHub CLI extension.
The repository argument can be specified in %[1]sOWNER/REPO%[1]s format as well as a full URL.
@ -306,8 +306,8 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {
To install an extension in development from the current directory, use %[1]s.%[1]s as the
value of the repository argument.
See the list of available extensions at <https://github.com/topics/gh-extension>.
`),
For the list of available extensions, see <https://github.com/topics/gh-extension>.
`, "`"),
Example: heredoc.Doc(`
$ gh extension install owner/gh-extension
$ gh extension install https://git.example.com/owner/gh-extension

View file

@ -94,7 +94,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
To create a release from an annotated git tag, first create one locally with
git, push the tag to GitHub, then run this command.
Use %[1]s--notes-from-tag%[1]s to automatically generate the release notes
from the annotated git tag.
from the annotated git tag.
When using automatically generated release notes, a release title will also be automatically
generated unless a title was explicitly passed. Additional release notes can be prepended to

View file

@ -171,9 +171,9 @@ func rootHelpFunc(f *cmdutil.Factory, command *cobra.Command, args []string) {
if _, ok := command.Annotations["help:environment"]; ok {
helpEntries = append(helpEntries, helpEntry{"ENVIRONMENT VARIABLES", command.Annotations["help:environment"]})
}
helpEntries = append(helpEntries, helpEntry{"LEARN MORE", `
Use 'gh <command> <subcommand> --help' for more information about a command.
Read the manual at https://cli.github.com/manual`})
helpEntries = append(helpEntries, helpEntry{"LEARN MORE", heredoc.Docf(`
Use %[1]sgh <command> <subcommand> --help%[1]s for more information about a command.
Read the manual at https://cli.github.com/manual`,"`")})
out := f.IOStreams.Out
for _, e := range helpEntries {

View file

@ -53,7 +53,7 @@ var HelpTopics = []helpTopic{
"github.com" host when not in a context of an existing repository. When setting this,
also set %[1]sGH_ENTERPRISE_TOKEN%[1]s.
%[1]sGH_REPO%[1]s: specify the GitHub repository in the "[HOST/]OWNER/REPO" format for commands
%[1]sGH_REPO%[1]s: specify the GitHub repository in the %[1]s[HOST/]OWNER/REPO%[1]s format for commands
that otherwise operate on a local repository.
%[1]sGH_EDITOR%[1]s, %[1]sGIT_EDITOR%[1]s, %[1]sVISUAL%[1]s, %[1]sEDITOR%[1]s (in order of precedence): the editor tool to use

View file

@ -126,7 +126,7 @@ func removeRun(opts *DeleteOptions) error {
if envName != "" {
fmt.Fprintf(opts.IO.Out, "%s Deleted variable %s from %s environment on %s\n", cs.SuccessIconWithColor(cs.Red), opts.VariableName, envName, target)
} else {
fmt.Fprintf(opts.IO.Out, "%s Deleted GitHub Actions variable %s from %s\n", cs.SuccessIconWithColor(cs.Red), opts.VariableName, target)
fmt.Fprintf(opts.IO.Out, "%s Deleted variable %s from %s\n", cs.SuccessIconWithColor(cs.Red), opts.VariableName, target)
}
}

View file

@ -219,7 +219,7 @@ func setRun(opts *SetOptions) error {
if envName != "" {
target += " environment " + envName
}
fmt.Fprintf(opts.IO.Out, "%s %s GitHub Actions variable %s for %s\n", cs.SuccessIcon(), result.Operation, result.Key, target)
fmt.Fprintf(opts.IO.Out, "%s %s variable %s for %s\n", cs.SuccessIcon(), result.Operation, result.Key, target)
}
return err