Skip to content

Commit 7614ffe

Browse files
committed
Add docs to release create/upload
1 parent 202d111 commit 7614ffe

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

pkg/cmd/release/create/create.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"strings"
1111

1212
"github.com/AlecAivazis/survey/v2"
13+
"github.com/MakeNowJust/heredoc"
1314
"github.com/cli/cli/internal/config"
1415
"github.com/cli/cli/internal/ghrepo"
1516
"github.com/cli/cli/internal/run"
@@ -62,7 +63,20 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
6263
cmd := &cobra.Command{
6364
Use: "create <tag> [<files>...]",
6465
Short: "Create a new release",
65-
Args: cobra.MinimumNArgs(1),
66+
Long: heredoc.Doc(`
67+
Create a new GitHub Release for a repository.
68+
69+
A list of asset files may be given to upload to the new release. To define a
70+
display label for an asset, append text starting with '#' after the file name.
71+
`),
72+
Example: heredoc.Doc(`
73+
# use release notes from a file
74+
$ gh release create v1.2.3 -F changelog.md
75+
76+
# upload a release asset with a display label
77+
$ gh release create v1.2.3 '/path/to/asset.zip#My display label'
78+
`),
79+
Args: cobra.MinimumNArgs(1),
6680
RunE: func(cmd *cobra.Command, args []string) error {
6781
// support `-R, --repo` override
6882
opts.BaseRepo = f.BaseRepo

pkg/cmd/release/upload/upload.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"net/http"
66
"strings"
77

8+
"github.com/MakeNowJust/heredoc"
89
"github.com/cli/cli/internal/ghrepo"
910
"github.com/cli/cli/pkg/cmd/release/shared"
1011
"github.com/cli/cli/pkg/cmdutil"
@@ -35,7 +36,13 @@ func NewCmdUpload(f *cmdutil.Factory, runF func(*UploadOptions) error) *cobra.Co
3536
cmd := &cobra.Command{
3637
Use: "upload <tag> <files>...",
3738
Short: "Upload assets to a release",
38-
Args: cobra.MinimumNArgs(2),
39+
Long: heredoc.Doc(`
40+
Upload asset files to a GitHub Release.
41+
42+
To define a display label for an asset, append text starting with '#' after the
43+
file name.
44+
`),
45+
Args: cobra.MinimumNArgs(2),
3946
RunE: func(cmd *cobra.Command, args []string) error {
4047
// support `-R, --repo` override
4148
opts.BaseRepo = f.BaseRepo

pkg/cmd/release/view/view.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func NewCmdView(f *cmdutil.Factory, runF func(*ViewOptions) error) *cobra.Comman
3535
Use: "view [<tag>]",
3636
Short: "View information about a release",
3737
Long: heredoc.Doc(`
38-
View information about a GitHub release.
38+
View information about a GitHub Release.
3939
4040
Without an explicit tag name argument, the latest release in the project
4141
is shown.

0 commit comments

Comments
 (0)