mirror of
https://github.com/Luzifer/vault-openvpn.git
synced 2024-11-14 11:02:45 +00:00
20 lines
305 B
Go
20 lines
305 B
Go
// +build windows
|
|
|
|
package cobra
|
|
|
|
import (
|
|
"os"
|
|
"time"
|
|
|
|
"github.com/inconshreveable/mousetrap"
|
|
)
|
|
|
|
var preExecHookFn = preExecHook
|
|
|
|
func preExecHook(c *Command) {
|
|
if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
|
|
c.Print(MousetrapHelpText)
|
|
time.Sleep(5 * time.Second)
|
|
os.Exit(1)
|
|
}
|
|
}
|