update vendor spf13/cobra to enforce required flags

This commit is contained in:
Di Xu
2017-11-20 12:40:51 +08:00
parent b047e8ea0d
commit ddf97084f5
24 changed files with 1977 additions and 1254 deletions

View File

@@ -11,14 +11,8 @@ import (
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() {
if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
c.Print(MousetrapHelpText)
time.Sleep(5 * time.Second)
os.Exit(1)