From 030ecacf8080e2ddb9ba2874e331de69af6b5b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Fri, 22 Jun 2018 14:55:00 +0200 Subject: [PATCH] Improve the help output of run --- internal/cli/run/run.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/cli/run/run.go b/internal/cli/run/run.go index dacd23d..103d499 100644 --- a/internal/cli/run/run.go +++ b/internal/cli/run/run.go @@ -4,11 +4,13 @@ import ( "errors" "fmt" "path/filepath" + "strings" "time" "github.com/alecthomas/kingpin" "github.com/apex/log" "github.com/ooni/probe-cli/internal/cli/root" + "github.com/ooni/probe-cli/internal/colors" "github.com/ooni/probe-cli/internal/database" "github.com/ooni/probe-cli/nettests" "github.com/ooni/probe-cli/nettests/groups" @@ -18,7 +20,14 @@ import ( func init() { cmd := root.Command("run", "Run a test group or OONI Run link") - nettestGroup := cmd.Arg("name", "the nettest group to run").Required().String() + var nettestGroupNames []string + for name := range groups.NettestGroups { + nettestGroupNames = append(nettestGroupNames, colors.Blue(name)) + } + + nettestGroup := cmd.Arg("name", + fmt.Sprintf("the nettest group to run. Supported tests are: %s", + strings.Join(nettestGroupNames, ", "))).Required().String() cmd.Action(func(_ *kingpin.ParseContext) error { log.Infof("Starting %s", *nettestGroup)