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

27 lines
433 B
Go
Raw Normal View History

// +build windows
package cobra
import (
2019-04-13 14:47:57 +02:00
"fmt"
"os"
"time"
"github.com/inconshreveable/mousetrap"
)
var preExecHookFn = preExecHook
func preExecHook(c *Command) {
2017-07-23 09:51:42 +02:00
if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
c.Print(MousetrapHelpText)
2019-04-13 14:47:57 +02:00
if MousetrapDisplayDuration > 0 {
time.Sleep(MousetrapDisplayDuration)
} else {
c.Println("Press return to continue...")
fmt.Scanln()
}
os.Exit(1)
}
}