-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
40 lines (36 loc) · 1014 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"flag"
"github.com/Luiggy102/ligapro-cli/cmd"
"github.com/Luiggy102/ligapro-cli/internal/utils"
)
func main() {
printTable := flag.Bool("tabla", false, "Muesta la tabla de posiciones actual")
printResults := flag.Bool("resultados", false, "Mostrar los últimos resultados")
printNext := flag.Bool("siguientes", false, "mostrar los próximos partidos")
printStrikers := flag.Bool("goleadores", false, "Mostrar tabla de goleadores")
printMatchday := flag.Int("fecha", 0, "Mostrar los partidos de dicha fecha")
year := flag.Int("año", 0, "año de la etapa a buscar")
season := flag.Int("etapa", 0, "etapa a buscar")
flag.Usage = utils.Help
flag.Parse()
switch {
case *printTable:
cmd.PrintTable(*year, *season)
return
case *printResults:
cmd.PrintResults()
return
case *printNext:
cmd.PrintNext()
return
case *printStrikers:
cmd.PrintStrikers()
return
case *printMatchday != 0:
cmd.PrintMatchday(*printMatchday)
return
default:
utils.Welcome()
}
}