Skip to content

Commit

Permalink
print usage on empty argument list (#14)
Browse files Browse the repository at this point in the history
An alternative for PR #12

Signed-off-by: Dmitry Shmulevich <[email protected]>
  • Loading branch information
dmitsh authored May 8, 2024
1 parent eab45e8 commit 0f2d0b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/knavigator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f2d0b6

Please sign in to comment.