diff options
Diffstat (limited to 'test/benchmarks/harness/harness.go')
-rw-r--r-- | test/benchmarks/harness/harness.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/benchmarks/harness/harness.go b/test/benchmarks/harness/harness.go index 68bd7b4cf..e14cce987 100644 --- a/test/benchmarks/harness/harness.go +++ b/test/benchmarks/harness/harness.go @@ -17,17 +17,31 @@ package harness import ( "flag" + "fmt" + "os" "gvisor.dev/gvisor/pkg/test/dockerutil" ) +var ( + help = flag.Bool("help", false, "print this usage message") +) + // Harness is a handle for managing state in benchmark runs. type Harness struct { } // Init performs any harness initilialization before runs. func (h *Harness) Init() error { + flag.Usage = func() { + fmt.Fprintf(os.Stderr, "Usage: %s -- --test.bench=<regex>\n", os.Args[0]) + flag.PrintDefaults() + } flag.Parse() + if flag.NFlag() == 0 || *help { + flag.Usage() + os.Exit(0) + } dockerutil.EnsureSupportedDockerVersion() return nil } |