dex/vendor/github.com/spf13/cobra/command_win.go

27 lines
433 B
Go
Raw Normal View History

2016-07-26 01:30:28 +05:30
// +build windows
package cobra
import (
"fmt"
2016-07-26 01:30:28 +05:30
"os"
"time"
"github.com/inconshreveable/mousetrap"
)
var preExecHookFn = preExecHook
func preExecHook(c *Command) {
if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
2016-07-26 01:30:28 +05:30
c.Print(MousetrapHelpText)
if MousetrapDisplayDuration > 0 {
time.Sleep(MousetrapDisplayDuration)
} else {
c.Println("Press return to continue...")
fmt.Scanln()
}
2016-07-26 01:30:28 +05:30
os.Exit(1)
}
}