2019-01-06 06:44:33 +08:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(cmdsCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
var cmdsCmd = &cobra.Command{
|
2019-01-07 05:34:56 +08:00
|
|
|
Use: "cmds",
|
|
|
|
Version: rootCmd.Version,
|
|
|
|
Short: "Command runner management utility",
|
|
|
|
Long: `Command runner management utility.`,
|
|
|
|
Args: cobra.NoArgs,
|
2019-01-06 06:44:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func printEvents(m map[string][]string) {
|
|
|
|
for evt, cmds := range m {
|
|
|
|
for i, cmd := range cmds {
|
|
|
|
fmt.Printf("%s(%d): %s\n", evt, i, cmd)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|