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 12:47:57 +00:00
"fmt"
"os"
"time"
"github.com/inconshreveable/mousetrap"
)
var preExecHookFn = preExecHook
func preExecHook(c *Command) {
2017-07-23 07:51:42 +00:00
if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
c.Print(MousetrapHelpText)
2019-04-13 12:47:57 +00:00
if MousetrapDisplayDuration > 0 {
time.Sleep(MousetrapDisplayDuration)
} else {
c.Println("Press return to continue...")
fmt.Scanln()
}
os.Exit(1)
}
}