ground-dashboard/ground/tool/main.go
2022-12-03 18:55:43 +00:00

28 lines
371 B
Go

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
}
}
}