This repository has been archived on 2023-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
dex/vendor/github.com/spf13/cobra/command_win.go

27 lines
433 B
Go
Raw Normal View History

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