mirror of
https://codeberg.org/portospaceteam/ground-dashboard.git
synced 2024-11-25 00:25:57 +00:00
28 lines
398 B
Go
28 lines
398 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
|
|
}
|
|
}
|
|
}
|