Skip to content

Commit f519989

Browse files
committed
move cobra mutation and document it
1 parent 15e1ad0 commit f519989

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmd/gh/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ func main() {
6161
}
6262
}
6363

64+
// Enable running gh from explorer.exe. Without this, the user is told to stop and run from a
65+
// terminal. With this, a user can clone a repo (or take other actions) directly from explorer.
66+
cobra.MousetrapHelpText = ""
67+
6468
rootCmd := root.NewCmdRoot(cmdFactory, command.Version, command.BuildDate)
6569

6670
cfg, err := cmdFactory.Config()

pkg/cmd/root/root.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import (
2525
)
2626

2727
func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *cobra.Command {
28-
cobra.MousetrapHelpText = ""
29-
3028
cmd := &cobra.Command{
3129
Use: "gh <command> <subcommand> [flags]",
3230
Short: "GitHub CLI",

0 commit comments

Comments
 (0)