filebrowser/cmd/cmds.go
1138-4EB 6712fa580b enable version subcmd and --version flag for root cmd and all subcmds
Former-commit-id: a9e681d47d47f9f09a22d8479705f62672f509b7 [formerly b7d17db57156675b06897bc289fe616628a47abb] [formerly e06d3b13b547356fb928288b09aaaaf1a60b8950 [formerly b4708348c6]]
Former-commit-id: 43b18221e14269bada106e867b666f67a692c992 [formerly bee15f87fc2ecf5e8b4a0d74f41bde7617aef12a]
Former-commit-id: 733aaa6f3d5e3fc80dbb65ccc028d9f6ff6f73b7
2019-01-08 16:20:23 +01:00

28 lines
453 B
Go

package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(cmdsCmd)
}
var cmdsCmd = &cobra.Command{
Use: "cmds",
Version: rootCmd.Version,
Short: "Command runner management utility",
Long: `Command runner management utility.`,
Args: cobra.NoArgs,
}
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)
}
}
}