1
0
Fork 0
mirror of https://github.com/Luzifer/s3sync.git synced 2024-10-18 14:34:20 +00:00
s3sync/vendor/github.com/spf13/cobra/command_win.go
Knut Ahlers ffdaf5c63f
Migrate and update Godeps
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-05-29 11:41:57 +02:00

26 lines
482 B
Go

// +build windows
package cobra
import (
"os"
"time"
"github.com/inconshreveable/mousetrap"
)
var preExecHookFn = preExecHook
// enables an information splash screen on Windows if the CLI is started from explorer.exe.
var MousetrapHelpText string = `This is a command line tool
You need to open cmd.exe and run it from there.
`
func preExecHook(c *Command) {
if mousetrap.StartedByExplorer() {
c.Print(MousetrapHelpText)
time.Sleep(5 * time.Second)
os.Exit(1)
}
}