-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathconfig.go
More file actions
31 lines (27 loc) · 771 Bytes
/
config.go
File metadata and controls
31 lines (27 loc) · 771 Bytes
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
package main
import (
"strings"
"github.com/urfave/cli/v2"
)
type config struct {
onlyDegression bool
failWithoutResults bool
threshold float64
base string
compare []string
benchCmd string
benchArgs []string
gitPath string
}
func newConfig(c *cli.Context) config {
return config{
onlyDegression: c.Bool("only-degression"),
failWithoutResults: c.Bool("fail-without-results"),
threshold: c.Float64("threshold"),
base: c.String("base"),
compare: strings.Split(c.String("compare"), ","),
benchCmd: c.String("bench-cmd"),
benchArgs: strings.Fields(c.String("bench-args")),
gitPath: c.String("git-path"),
}
}