@@ -27,7 +27,7 @@ type BrowseOptions struct {
2727 SelectorArg string
2828
2929 Branch string
30- SHA string
30+ Commit string
3131 ProjectsFlag bool
3232 SettingsFlag bool
3333 WikiFlag bool
@@ -81,8 +81,9 @@ func NewCmdBrowse(f *cmdutil.Factory, runF func(*BrowseOptions) error) *cobra.Co
8181 }
8282
8383 if err := cmdutil .MutuallyExclusive (
84- "specify only one of `--branch`, `--projects`, `--wiki`, or `--settings`" ,
84+ "specify only one of `--branch`, `--commit`, `-- projects`, `--wiki`, or `--settings`" ,
8585 opts .Branch != "" ,
86+ opts .Commit != "" ,
8687 opts .WikiFlag ,
8788 opts .SettingsFlag ,
8889 opts .ProjectsFlag ,
@@ -103,7 +104,7 @@ func NewCmdBrowse(f *cmdutil.Factory, runF func(*BrowseOptions) error) *cobra.Co
103104 cmd .Flags ().BoolVarP (& opts .SettingsFlag , "settings" , "s" , false , "Open repository settings" )
104105 cmd .Flags ().BoolVarP (& opts .NoBrowserFlag , "no-browser" , "n" , false , "Print destination URL instead of opening the browser" )
105106 cmd .Flags ().StringVarP (& opts .Branch , "branch" , "b" , "" , "Select another branch by passing in the branch name" )
106- cmd .Flags ().StringVarP (& opts .SHA , "sha " , "a " , "" , "Select a commit by passing in the SHA hash" )
107+ cmd .Flags ().StringVarP (& opts .Commit , "commit " , "c " , "" , "Select a commit by passing in the SHA hash" )
107108
108109 return cmd
109110}
@@ -129,8 +130,8 @@ func runBrowse(opts *BrowseOptions) error {
129130 url += "/wiki"
130131 } else if opts .Branch != "" {
131132 url += "/tree/" + opts .Branch + "/"
132- } else if opts .SHA != "" {
133- url += "/tree/" + opts .SHA + "/"
133+ } else if opts .Commit != "" {
134+ url += "/tree/" + opts .Commit + "/"
134135 }
135136 } else {
136137 if isNumber (opts .SelectorArg ) {
@@ -142,8 +143,8 @@ func runBrowse(opts *BrowseOptions) error {
142143 }
143144 if opts .Branch != "" {
144145 url += "/tree/" + opts .Branch + "/"
145- } else if opts .SHA != "" {
146- url += "/tree/" + opts .SHA + "/"
146+ } else if opts .Commit != "" {
147+ url += "/tree/" + opts .Commit + "/"
147148 } else {
148149 apiClient := api .NewClientFromHTTP (httpClient )
149150 branchName , err := api .RepoDefaultBranch (apiClient , baseRepo )
0 commit comments