vikunja-api/vendor/github.com/spf13/cobra/command_win.go
renovate 6d1b123a25 Update module spf13/cobra to v0.0.7 (#271)
Update module spf13/cobra to v0.0.7

Reviewed-on: https://kolaente.dev/vikunja/api/pulls/271
2020-04-08 19:44:10 +00:00

26 lines
433 B
Go

// +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)
}
}