Tizen_4.0 base
[platform/upstream/docker-engine.git] / vendor / github.com / spf13 / cobra / command_win.go
1 // +build windows
2
3 package cobra
4
5 import (
6         "os"
7         "time"
8
9         "github.com/inconshreveable/mousetrap"
10 )
11
12 var preExecHookFn = preExecHook
13
14 // enables an information splash screen on Windows if the CLI is started from explorer.exe.
15 var MousetrapHelpText string = `This is a command line tool
16
17 You need to open cmd.exe and run it from there.
18 `
19
20 func preExecHook(c *Command) {
21         if mousetrap.StartedByExplorer() {
22                 c.Print(MousetrapHelpText)
23                 time.Sleep(5 * time.Second)
24                 os.Exit(1)
25         }
26 }