vendor/github.com/spf13/cobra/command_win.go
changeset 251 1c52a0eeb952
parent 242 2a9ec03fe5a1
child 260 445e01aede7e
--- a/vendor/github.com/spf13/cobra/command_win.go	Wed Sep 18 19:17:42 2019 +0200
+++ b/vendor/github.com/spf13/cobra/command_win.go	Sun Feb 16 18:54:01 2020 +0100
@@ -3,6 +3,7 @@
 package cobra
 
 import (
+	"fmt"
 	"os"
 	"time"
 
@@ -14,7 +15,12 @@
 func preExecHook(c *Command) {
 	if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
 		c.Print(MousetrapHelpText)
-		time.Sleep(5 * time.Second)
+		if MousetrapDisplayDuration > 0 {
+			time.Sleep(MousetrapDisplayDuration)
+		} else {
+			c.Println("Press return to continue...")
+			fmt.Scanln()
+		}
 		os.Exit(1)
 	}
 }