Browse Source

修改 依赖

liuyuqi-dellpc 5 years ago
parent
commit
92143b150f
1 changed files with 26 additions and 0 deletions
  1. 26 0
      vendor/github.com/spf13/cobra/command_win.go

+ 26 - 0
vendor/github.com/spf13/cobra/command_win.go

@@ -0,0 +1,26 @@
+// +build windows
+
+package cobra
+
+import (
+	"fmt"
+	"os"
+	"time"
+
+	"github.com/inconshreveable/mousetrap"
+)
+
+var preExecHookFn = preExecHook
+
+func preExecHook(c *Command) {
+	if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
+		c.Print(MousetrapHelpText)
+		if MousetrapDisplayDuration > 0 {
+			time.Sleep(MousetrapDisplayDuration)
+		} else {
+			c.Println("Press return to continue...")
+			fmt.Scanln()
+		}
+		os.Exit(1)
+	}
+}