updating github.com/spf13/cobra to v0.0.4

This commit is contained in:
Davanum Srinivas
2019-06-14 11:34:37 -04:00
parent 56612c8b2e
commit 1b401bdab7
43 changed files with 331 additions and 91 deletions

View File

@@ -3,6 +3,7 @@
package cobra
import (
"fmt"
"os"
"time"
@@ -14,7 +15,12 @@ var preExecHookFn = preExecHook
func preExecHook(c *Command) {
if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
c.Print(MousetrapHelpText)
time.Sleep(5 * time.Second)
if MousetrapDisplayDuration > 0 {
time.Sleep(MousetrapDisplayDuration)
} else {
c.Println("Press return to continue...")
fmt.Scanln()
}
os.Exit(1)
}
}