@@ -41,10 +41,12 @@ import (
4141)
4242
4343var (
44- configPathFlag = flag .String ("config" , "" , "path to the benchmark config file" )
45- outPathFlag = flag .String ("out" , "./results/${now}" , "path to the output folder" )
46- toolsFlag = internal .StringsFlag ("tool" , nil , "filter tool to be tested (can be provided multiple times)" )
47- testsFlag = internal .StringsFlag ("tests" , nil , "filter test to run (can be provided multiple times)" )
44+ configPathFlag = flag .String ("config" , "" , "Path to the benchmark config file" )
45+ outPathFlag = flag .String ("out" , "./results/${now}" , "Path to the output folder" )
46+ toolsFlag = internal .StringsFlag ("tool" , nil , "Filter tool to be tested (can be provided multiple times)" )
47+ testsFlag = internal .StringsFlag ("tests" , nil , "Filter test to run (can be provided multiple times)" )
48+
49+ versionFlag = flag .Bool ("v" , false , "Print version" )
4850)
4951
5052// version is set at build time.
@@ -60,6 +62,11 @@ func main() {
6062func mainE () error {
6163 flag .Parse ()
6264
65+ if * versionFlag {
66+ fmt .Println ("benchi" , version )
67+ return nil
68+ }
69+
6370 if configPathFlag == nil || strings .TrimSpace (* configPathFlag ) == "" {
6471 return fmt .Errorf ("config path is required" )
6572 }
0 commit comments