http urls monitor.

command_win.go 305B

123456789101112131415161718192021
  1. // +build windows
  2. package cobra
  3. import (
  4. "os"
  5. "time"
  6. "github.com/inconshreveable/mousetrap"
  7. )
  8. var preExecHookFn = preExecHook
  9. func preExecHook(c *Command) {
  10. if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
  11. c.Print(MousetrapHelpText)
  12. time.Sleep(5 * time.Second)
  13. os.Exit(1)
  14. }
  15. }