mirror of
https://github.com/rclone/rclone.git
synced 2024-11-30 04:23:48 +08:00
f7af730b50
This is using godep to manage the vendor directory.
27 lines
482 B
Go
27 lines
482 B
Go
// +build windows
|
|
|
|
package cobra
|
|
|
|
import (
|
|
"os"
|
|
"time"
|
|
|
|
"github.com/inconshreveable/mousetrap"
|
|
)
|
|
|
|
var preExecHookFn = preExecHook
|
|
|
|
// enables an information splash screen on Windows if the CLI is started from explorer.exe.
|
|
var MousetrapHelpText string = `This is a command line tool
|
|
|
|
You need to open cmd.exe and run it from there.
|
|
`
|
|
|
|
func preExecHook(c *Command) {
|
|
if mousetrap.StartedByExplorer() {
|
|
c.Print(MousetrapHelpText)
|
|
time.Sleep(5 * time.Second)
|
|
os.Exit(1)
|
|
}
|
|
}
|