-
Notifications
You must be signed in to change notification settings - Fork 0
/
daggre_cli.go
59 lines (53 loc) · 1.29 KB
/
daggre_cli.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
package main
import (
"github.com/urfave/cli"
cliModule "github.com/utmhikari/daggre/internal/cli"
"log"
"os"
)
func main() {
app := cli.NewApp()
app.Name = "daggre-cli"
app.Usage = "DAta-AGGREgator client, a tool to handle aggregation on lists of dict-data"
app.Version = "0.9.9"
args := &cliModule.Args{}
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "workdir",
Usage: "working directory of source files (optional)",
Value: "",
Destination: &args.WorkDir,
},
cli.StringFlag{
Name: "datapath",
Usage: "data source file path",
Value: "data.json",
Destination: &args.DataPath,
},
cli.StringFlag{
Name: "aggrepath",
Usage: "aggregator file path",
Value: "aggre.json",
Destination: &args.AggrePath,
},
cli.StringFlag{
Name: "outputpath",
Usage: "aggregation output file path",
Value: "output.json",
Destination: &args.OutputPath,
},
cli.StringFlag{
Name: "statspath",
Usage: "aggregation stats file path",
Value: "stats.json",
Destination: &args.StatsPath,
},
}
app.Action = func(c *cli.Context) {
log.Println("start daggre-cli...")
cliModule.Start(args)
}
if err := app.Run(os.Args); err != nil {
log.Panic(err)
}
}