aboutsummaryrefslogblamecommitdiffstats
path: root/vendor/github.com/spf13/cobra/command_win.go
blob: edec728e4f5af31cbfec3e32fd4c7d4c9a301db0 (plain) (tree)



















                                                                     
// +build windows

package cobra

import (
	"os"
	"time"

	"github.com/inconshreveable/mousetrap"
)

var preExecHookFn = preExecHook

func preExecHook(c *Command) {
	if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
		c.Print(MousetrapHelpText)
		time.Sleep(5 * time.Second)
		os.Exit(1)
	}
}