ground-dashboard/ground/tool/main.go

28 lines
398 B
Go
Raw Normal View History

2022-12-05 22:25:36 +00:00
package main
import (
"log"
"os"
)
func main() {
if len(os.Args) < 2 {
log.Fatal("not enough arguments")
}
cmds := []task{
newTaskConvert(),
newTaskSummary(),
newTaskChart(),
}
for _, cmd := range cmds {
if cmd.name() == os.Args[1] {
cmd.FlagSet().Parse(os.Args[2:])
err := cmd.run()
if err != nil {
log.Panic(err)
}
return
}
}
}