1
0
Fork 0
mirror of https://github.com/spf13/cobra synced 2025-05-02 11:27:21 +00:00
spf13--cobra/command_win.go
Albert Nigmatzianov c46add8a65 Add ability to disable mousetrap
Fix 
Close  (no progress there)
2017-07-11 14:08:33 +02:00

20 lines
305 B
Go

// +build windows
package cobra
import (
"os"
"time"
"github.com/inconshreveable/mousetrap"
)
var preExecHookFn = preExecHook
func preExecHook(c *Command) {
if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
c.Print(MousetrapHelpText)
time.Sleep(5 * time.Second)
os.Exit(1)
}
}