-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
79 lines (69 loc) · 1.29 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package main
import (
"log"
"os"
"github.com/stqp/go-caniuse/cmd"
"github.com/stqp/go-caniuse/cmd/list"
"github.com/stqp/go-caniuse/pkg"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = "go-caniuse"
app.Usage = "show browser support status table for web technologies."
app.Action = pkg.Run
app.Version = "dev"
flags := []cli.Flag{
cli.StringFlag{
Name: "format, f",
Value: "table",
Usage: "format (table, csv, json)",
},
cli.StringFlag{
Name: "output, o",
Value: "",
Usage: "output file name",
},
cli.StringFlag{
Name: "browser, b",
Value: "all",
Usage: "browser name.",
},
}
app.Commands = []cli.Command{
{
Name: "list",
Usage: "list something.",
Subcommands: []cli.Command{
{
Name: "browser",
Usage: "list all browsers.",
Action: list.Browser,
Flags: flags,
},
{
Name: "feature",
Usage: "list all feature.",
Action: list.Feature,
Flags: flags,
},
{
Name: "status",
Usage: "list support status flags.",
Action: list.Status,
Flags: flags,
},
},
},
{
Name: "update",
Usage: "update data source file",
Action: cmd.Update,
},
}
app.Flags = flags
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}