@@ -28,7 +28,6 @@ type BrowseOptions struct {
2828
2929 Branch string
3030 ProjectsFlag bool
31- RepoFlag bool
3231 SettingsFlag bool
3332 WikiFlag bool
3433}
@@ -79,22 +78,22 @@ func NewCmdBrowse(f *cmdutil.Factory, runF func(*BrowseOptions) error) *cobra.Co
7978 opts .SelectorArg = args [0 ]
8079 }
8180
82- if err := cmdutil .MutuallyExclusive ("" , opts .ProjectsFlag , opts .SettingsFlag ); err != nil {
81+ if err := cmdutil .MutuallyExclusive ("cannot use --projects with --settings " , opts .ProjectsFlag , opts .SettingsFlag ); err != nil {
8382 return err
8483 }
85- if err := cmdutil .MutuallyExclusive ("" , opts .ProjectsFlag , opts .WikiFlag ); err != nil {
84+ if err := cmdutil .MutuallyExclusive ("cannot use --projects with --wiki " , opts .ProjectsFlag , opts .WikiFlag ); err != nil {
8685 return err
8786 }
88- if err := cmdutil .MutuallyExclusive ("" , opts .ProjectsFlag , opts .Branch != "" ); err != nil {
87+ if err := cmdutil .MutuallyExclusive ("cannot use --projects with --branch " , opts .ProjectsFlag , opts .Branch != "" ); err != nil {
8988 return err
9089 }
91- if err := cmdutil .MutuallyExclusive ("" , opts .SettingsFlag , opts .WikiFlag ); err != nil {
90+ if err := cmdutil .MutuallyExclusive ("cannot use --settings with --wiki " , opts .SettingsFlag , opts .WikiFlag ); err != nil {
9291 return err
9392 }
94- if err := cmdutil .MutuallyExclusive ("" , opts .SettingsFlag , opts .Branch != "" ); err != nil {
93+ if err := cmdutil .MutuallyExclusive ("cannot use --settings with --branch " , opts .SettingsFlag , opts .Branch != "" ); err != nil {
9594 return err
9695 }
97- if err := cmdutil .MutuallyExclusive ("" , opts .WikiFlag , opts .Branch != "" ); err != nil {
96+ if err := cmdutil .MutuallyExclusive ("cannot use --wiki with --branch " , opts .WikiFlag , opts .Branch != "" ); err != nil {
9897 return err
9998 }
10099
@@ -129,20 +128,17 @@ func runBrowse(opts *BrowseOptions) error {
129128 url := ghrepo .GenerateRepoURL (baseRepo , "" )
130129
131130 if opts .ProjectsFlag {
132- url += "/projects"
133- err := opts .Browser .Browse (url )
131+ err := opts .Browser .Browse (url + "/projects" )
134132 return err
135133 }
136134
137135 if opts .SettingsFlag {
138- url += "/settings"
139- err := opts .Browser .Browse (url )
136+ err := opts .Browser .Browse (url + "/settings" )
140137 return err
141138 }
142139
143140 if opts .WikiFlag {
144- url += "/wiki"
145- err := opts .Browser .Browse (url )
141+ err := opts .Browser .Browse (url + "/wiki" )
146142 return err
147143 }
148144
@@ -177,7 +173,7 @@ func runBrowse(opts *BrowseOptions) error {
177173
178174 err = opts .Browser .Browse (url )
179175 if opts .IO .IsStdoutTTY () && err == nil {
180- fmt .Fprintf (opts .IO .Out , "now opening %s in browser . . . \n " , url )
176+ fmt .Fprintf (opts .IO .Out , "now opening %s in browser\n " , url )
181177 }
182178 return err
183179}
0 commit comments