-
Notifications
You must be signed in to change notification settings - Fork 2
/
flags.go
50 lines (48 loc) · 1.11 KB
/
flags.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
package main
import (
"github.com/chainbound/apollo/types"
"github.com/urfave/cli/v2"
)
func BuildFlags(opts *types.ApolloOpts) []cli.Flag {
return []cli.Flag{
&cli.BoolFlag{
Name: "realtime",
Aliases: []string{"R"},
Usage: "Run apollo in realtime",
Destination: &opts.Realtime,
},
&cli.BoolFlag{
Name: "db",
Usage: "Save results in database",
Destination: &opts.Db,
},
&cli.BoolFlag{
Name: "csv",
Usage: "Save results in csv file",
Destination: &opts.Csv,
},
&cli.BoolFlag{
Name: "stdout",
Usage: "Print to stdout",
Destination: &opts.Stdout,
},
&cli.IntFlag{
Name: "rate-limit",
Usage: "Rate limit `RPS` in max requests per second",
Destination: &opts.RateLimit,
Value: 100,
},
&cli.IntFlag{
Name: "log-level",
Usage: "Log level from -1 to 5",
Destination: &opts.LogLevel,
Value: 1,
},
&cli.IntFlag{
Name: "log-parts",
Usage: "Amount of parts to filter logs in",
Destination: &opts.LogParts,
Value: 50,
},
}
}