mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
dc0a400738
full diff: https://github.com/spf13/cobra/compare/v0.0.3...v1.0.0 Notable Changes - Fish completion (including support for Go custom completion) - API (urgent): Rename BashCompDirectives to ShellCompDirectives - Remove/replace SetOutput on Command - deprecated - Custom completions coded in Go (instead of Bash) - Partial Revert of 922 - Correct documentation for InOrStdin - Apply formatting to templates - Revert change so help is printed on stdout again - Update md2man to v2.0.0 - update viper to v1.4.0 - Update cmd/root.go example in README.md Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
26 lines
433 B
Go
26 lines
433 B
Go
// +build windows
|
|
|
|
package cobra
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"time"
|
|
|
|
"github.com/inconshreveable/mousetrap"
|
|
)
|
|
|
|
var preExecHookFn = preExecHook
|
|
|
|
func preExecHook(c *Command) {
|
|
if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
|
|
c.Print(MousetrapHelpText)
|
|
if MousetrapDisplayDuration > 0 {
|
|
time.Sleep(MousetrapDisplayDuration)
|
|
} else {
|
|
c.Println("Press return to continue...")
|
|
fmt.Scanln()
|
|
}
|
|
os.Exit(1)
|
|
}
|
|
}
|