blob: edec728e4f5af31cbfec3e32fd4c7d4c9a301db0 [file] [log] [blame]
Matthias Andreas Benkard832a54e2019-01-29 09:27:38 +01001// +build windows
2
3package cobra
4
5import (
6 "os"
7 "time"
8
9 "github.com/inconshreveable/mousetrap"
10)
11
12var preExecHookFn = preExecHook
13
14func preExecHook(c *Command) {
15 if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
16 c.Print(MousetrapHelpText)
17 time.Sleep(5 * time.Second)
18 os.Exit(1)
19 }
20}