/
githubmirror
/
cobra
Обзор
Документация
Войти
/
githubmirror
/
cobra
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
0.0.5
command_win.go
26 строк
433 B
Willi Eggeling
added variable to allow configuration of mousetrap message duration (#809)
21 мар 2019, 03:05
21 мар 2019, 03:05
67fc483
Код
Авторство
О чём код?
// +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) } }