From 0f2d0b6f533b77442a5ce427a219e38a3260e234 Mon Sep 17 00:00:00 2001 From: Dmitry Shmulevich Date: Wed, 8 May 2024 16:44:39 -0700 Subject: [PATCH] print usage on empty argument list (#14) An alternative for PR #12 Signed-off-by: Dmitry Shmulevich --- cmd/knavigator/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/knavigator/main.go b/cmd/knavigator/main.go index 72aa59e..75da8e3 100644 --- a/cmd/knavigator/main.go +++ b/cmd/knavigator/main.go @@ -39,6 +39,11 @@ func mainInternal() error { klog.InitFlags(nil) flag.Parse() + if len(taskConfigs) == 0 { + flag.Usage() + return fmt.Errorf("missing task config") + } + taskconfigs, err := config.NewFromPaths(taskConfigs) if err != nil { return err