Improving command line interface (#4689)

Этот коммит содержится в:
Christopher Speller
2016-12-06 10:49:34 -05:00
коммит произвёл GitHub
родитель dcf11a14d8
Коммит 026553e4f8
130 изменённых файлов: 16375 добавлений и 669 удалений

26
vendor/github.com/spf13/cobra/command_win.go сгенерированный поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1,26 @@
// +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)
}
}