Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "watch", Short: "Watch Util", Aliases: []string{"w"}, Run: func(c *cobra.Command, args []string) { i := 0 for { strArgs := strings.Join(args, " ") if FlagVerbose { fmt.Printf("%d: %s\n", i, strArgs) } cmd := exec.Command("/bin/sh", "-c", strArgs) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr err := cmd.Run() if err != nil { if FlagVerbose { log.Println(err) } } time.Sleep(time.Duration(FlagSleepTime) * time.Millisecond) i++ } }, }
View Source
var FlagSleepTime int
View Source
var FlagVerbose bool
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.