Skip to content
Myr

command_win.go

This file

Path

command_win.go

27 lines · 452 bytes · Go

Last changed by

ci: test golang 1.16.x and 1.17.x too (#1425)Unai Martinez-Corralbefore adoption4fd30b6

History of this file

Take it

1//go:build windows2// +build windows34package cobra56import (7	"fmt"8	"os"9	"time"1011	"github.com/inconshreveable/mousetrap"12)1314var preExecHookFn = preExecHook1516func preExecHook(c *Command) {17	if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {18		c.Print(MousetrapHelpText)19		if MousetrapDisplayDuration > 0 {20			time.Sleep(MousetrapDisplayDuration)21		} else {22			c.Println("Press return to continue...")23			fmt.Scanln()24		}25		os.Exit(1)26	}27}