-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflags.go
67 lines (58 loc) · 1.37 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package main
import (
"github.com/urfave/cli/v2"
"github.com/obalunenko/advent-of-code/internal/puzzles"
)
const (
flagElapsed = "elapsed"
flagShortElapsed = "e"
flagBenchmark = "bench"
flagShortBenchmark = "b"
flagSession = "session"
flagShortSession = "s"
)
func cmdRunFlags() []cli.Flag {
var res []cli.Flag
elapsed := cli.BoolFlag{
Name: flagElapsed,
Aliases: []string{flagShortElapsed},
Usage: "Enables elapsed time metric",
EnvVars: nil,
FilePath: "",
Required: false,
Hidden: false,
Value: false,
DefaultText: "",
Destination: nil,
HasBeenSet: false,
}
benchmark := cli.BoolFlag{
Name: flagBenchmark,
Aliases: []string{flagShortBenchmark},
Usage: "Enables benchmark metric",
EnvVars: nil,
FilePath: "",
Required: false,
Hidden: false,
Value: false,
DefaultText: "",
Destination: nil,
HasBeenSet: false,
}
session := cli.StringFlag{
Name: flagSession,
Aliases: []string{flagShortSession},
Usage: "AOC auth session to get inputs",
EnvVars: []string{puzzles.AOCSession},
FilePath: "",
Required: true,
Hidden: false,
TakesFile: false,
Value: "",
DefaultText: "",
Destination: nil,
HasBeenSet: false,
}
res = append(res, &elapsed, &benchmark, &session)
return res
}