-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: make it possible to pass a command directly (#9)
* fix: make it possible to pass a command directly * fix: lint issue * chore(README): update
- Loading branch information
Showing
4 changed files
with
58 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
package main | ||
|
||
import "github.com/urfave/cli/v2" | ||
import ( | ||
"strings" | ||
|
||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
type config struct { | ||
args []string | ||
onlyDegression bool | ||
threshold float64 | ||
base string | ||
bench string | ||
benchmem bool | ||
benchtime string | ||
tags string | ||
benchCmd string | ||
benchArgs []string | ||
} | ||
|
||
func newConfig(c *cli.Context) config { | ||
return config{ | ||
args: c.Args().Slice(), | ||
onlyDegression: c.Bool("only-degression"), | ||
threshold: c.Float64("threshold"), | ||
base: c.String("base"), | ||
bench: c.String("bench"), | ||
benchmem: c.Bool("benchmem"), | ||
benchtime: c.String("benchtime"), | ||
tags: c.String("tags"), | ||
benchCmd: c.String("bench-cmd"), | ||
benchArgs: strings.Fields(c.String("bench-args")), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.