mirror of https://github.com/dexidp/dex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
482 B
26 lines
482 B
// +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) |
|
} |
|
}
|
|
|