go.mod: spf13/cobra v1.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-08-26 11:24:43 +02:00
parent f9c1b86feb
commit 79ead619be
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
43 changed files with 3224 additions and 455 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)
}
}