Skip to content

Inconsistent format of examples in help text #10449

@iamazeem

Description

@iamazeem

Describe the bug

The format of examples is not consistent.

Here are a few examples:

Example: heredoc.Doc(`
# Get a trusted_root.jsonl for both Sigstore Public Good and GitHub's instance
gh attestation trusted-root

Example: heredoc.Doc(`
$ gh auth refresh --scopes write:org,read:public_key
# => open a browser to add write:org and read:public_key scopes
$ gh auth refresh
# => open a browser to ensure your authentication credentials have the correct minimum scopes

cli/pkg/cmd/api/api.go

Lines 126 to 133 in b642da2

Example: heredoc.Doc(`
# list releases in the current repository
$ gh api repos/{owner}/{repo}/releases
# post an issue comment
$ gh api repos/{owner}/{repo}/issues/123/comments -f body='Hi from CLI'
# post nested parameter read from a file

Example: heredoc.Doc(`
# List caches for current repository
$ gh cache list

Affected version

$ gh --version 
gh version 2.67.0 (2025-02-11)
https://github.com/cli/cli/releases/tag/v2.67.0

Steps to reproduce the behavior

Run commands from above examples with --help flag.

Expected vs actual behavior

A consistent format should be followed across all commands.

Suggested format:

# Description (Sentence case)
$ gh ...

Logs

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions