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
433 B
26 lines
433 B
// +build windows |
|
|
|
package cobra |
|
|
|
import ( |
|
"fmt" |
|
"os" |
|
"time" |
|
|
|
"github.com/inconshreveable/mousetrap" |
|
) |
|
|
|
var preExecHookFn = preExecHook |
|
|
|
func preExecHook(c *Command) { |
|
if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { |
|
c.Print(MousetrapHelpText) |
|
if MousetrapDisplayDuration > 0 { |
|
time.Sleep(MousetrapDisplayDuration) |
|
} else { |
|
c.Println("Press return to continue...") |
|
fmt.Scanln() |
|
} |
|
os.Exit(1) |
|
} |
|
}
|
|
|