File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ import (
66 "strconv"
77 "strings"
88
9+ "github.com/MakeNowJust/heredoc"
10+ "github.com/cli/cli/api"
911 "github.com/cli/cli/internal/ghrepo"
1012 "github.com/cli/cli/pkg/cmdutil"
1113 "github.com/cli/cli/pkg/iostreams"
1214 "github.com/spf13/cobra"
13-
14- "github.com/cli/cli/api"
1515)
1616
1717type browser interface {
@@ -60,6 +60,29 @@ func NewCmdBrowse(f *cmdutil.Factory) *cobra.Command {
6060 Use : "browse" , // necessary!!! This is the cmd that gets passed on the prompt
6161 Args : cobra .RangeArgs (0 , 2 ), // make sure only one arg at most is passed
6262
63+ Example : heredoc .Doc (`
64+ $ gh browse
65+ #=> Opens repository in browser
66+
67+ $ gh browse 217
68+ #=> Opens issue or pull request 217
69+
70+ $ gh browse --settings
71+ #=> Opens repository settings in browser
72+
73+ $ gh browse src/fileName:312 --branch main
74+ #=> Opens src/fileName at line 312 in main branch
75+ ` ),
76+
77+ Annotations : map [string ]string {
78+ "IsCore" : "true" ,
79+ "help:arguments" : heredoc .Doc (`
80+ A browse location can be supplied as an argument in any of the following formats:
81+ - by number, e.g. "123"; or
82+ - by file or branch name, e.g. "main.java" or "trunk".
83+ ` ),
84+ },
85+
6386 Run : func (cmd * cobra.Command , args []string ) {
6487
6588 if len (args ) > 1 {
You can’t perform that action at this time.
0 commit comments