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