Skip to content

Commit e10a3f1

Browse files
committed
minor usage improvements
1 parent a85ef92 commit e10a3f1

File tree

7 files changed

+25
-14
lines changed

7 files changed

+25
-14
lines changed

pkg/cmd/run/rerun/rerun.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func NewCmdRerun(f *cmdutil.Factory, runF func(*RerunOptions) error) *cobra.Comm
3131

3232
cmd := &cobra.Command{
3333
Use: "rerun [<run-id>]",
34-
Short: "Rerun a given run",
34+
Short: "Rerun a failed run",
3535
Args: cobra.MaximumNArgs(1),
3636
RunE: func(cmd *cobra.Command, args []string) error {
3737
// support `-R, --repo` override

pkg/cmd/run/view/view.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,20 @@ func NewCmdView(f *cmdutil.Factory, runF func(*ViewOptions) error) *cobra.Comman
9191
Short: "View a summary of a workflow run",
9292
Args: cobra.MaximumNArgs(1),
9393
Example: heredoc.Doc(`
94-
# Interactively select a run to view, optionally drilling down to a job
95-
$ gh run view
96-
97-
# View a specific run
98-
$ gh run view 12345
99-
94+
# Interactively select a run to view, optionally selecting a single job
95+
$ gh run view
96+
97+
# View a specific run
98+
$ gh run view 12345
99+
100100
# View a specific job within a run
101101
$ gh run view --job 456789
102-
102+
103103
# View the full log for a specific job
104104
$ gh run view --log --job 456789
105-
106-
# Exit non-zero if a run failed
107-
$ gh run view 0451 --exit-status && echo "run pending or passed"
105+
106+
# Exit non-zero if a run failed
107+
$ gh run view 0451 --exit-status && echo "run pending or passed"
108108
`),
109109
RunE: func(cmd *cobra.Command, args []string) error {
110110
// support `-R, --repo` override

pkg/cmd/run/watch/watch.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"runtime"
88
"time"
99

10+
"github.com/MakeNowJust/heredoc"
1011
"github.com/cli/cli/api"
1112
"github.com/cli/cli/internal/ghrepo"
1213
"github.com/cli/cli/pkg/cmd/run/shared"
@@ -40,8 +41,15 @@ func NewCmdWatch(f *cmdutil.Factory, runF func(*WatchOptions) error) *cobra.Comm
4041
}
4142

4243
cmd := &cobra.Command{
43-
Use: "watch <run-selector>",
44+
Use: "watch <run-id>",
4445
Short: "Watch a run until it completes, showing its progress",
46+
Example: heredoc.Doc(`
47+
# Watch a run until it's done
48+
gh run watch
49+
50+
# Run some other command when the run is finished
51+
gh run watch && notify-send "run is done!"
52+
`),
4553
RunE: func(cmd *cobra.Command, args []string) error {
4654
// support `-R, --repo` override
4755
opts.BaseRepo = f.BaseRepo

pkg/cmd/workflow/disable/disable.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func NewCmdDisable(f *cmdutil.Factory, runF func(*DisableOptions) error) *cobra.
3131
cmd := &cobra.Command{
3232
Use: "disable [<workflow ID> | <workflow name>]",
3333
Short: "Disable a workflow",
34+
Long: "Disable a workflow, preventing it from running or showing up when listing workflows.",
3435
Args: cobra.MaximumNArgs(1),
3536
RunE: func(cmd *cobra.Command, args []string) error {
3637
// support `-R, --repo` override

pkg/cmd/workflow/enable/enable.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func NewCmdEnable(f *cmdutil.Factory, runF func(*EnableOptions) error) *cobra.Co
3131
cmd := &cobra.Command{
3232
Use: "enable [<workflow ID> | <workflow name>]",
3333
Short: "Enable a workflow",
34+
Long: "Enable a workflow, allowing it to be run and show up when listing workflows.",
3435
Args: cobra.MaximumNArgs(1),
3536
RunE: func(cmd *cobra.Command, args []string) error {
3637
// support `-R, --repo` override

pkg/cmd/workflow/list/list.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
3434

3535
cmd := &cobra.Command{
3636
Use: "list",
37-
Short: "List GitHub Actions workflows",
37+
Short: "List workflows",
38+
Long: "List workflow files, hiding disabled workflows by default.",
3839
Args: cobra.NoArgs,
3940
RunE: func(cmd *cobra.Command, args []string) error {
4041
// support `-R, --repo` override

pkg/cmd/workflow/run/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func NewCmdRun(f *cmdutil.Factory, runF func(*RunOptions) error) *cobra.Command
4747

4848
cmd := &cobra.Command{
4949
Use: "run [<workflow-ID> | <workflow-name>]",
50-
Short: "Create a dispatch event for a workflow, starting a run",
50+
Short: "Run a workflow by creating a workflow_dispatch event",
5151
Long: heredoc.Doc(`
5252
Create a workflow_dispatch event for a given workflow.
5353

0 commit comments

Comments
 (0)