depgraph: Fix spurious error when no subcommand name is passed (#61871)

This confused me:

```
terminal command () doesn't define an Exec function
```

Now it prints a help text.

Test plan:

Verified the above behavior by hand.
This commit is contained in:
Erik Seliger 2024-04-15 16:10:44 +02:00 committed by GitHub
parent e4042dd629
commit 9fab1b4e1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,9 @@ var rootFlagSet = flag.NewFlagSet("depgraph", flag.ExitOnError)
var rootCommand = &ffcli.Command{
ShortUsage: "depgraph [flags] <subcommand>",
FlagSet: rootFlagSet,
Exec: func(ctx context.Context, args []string) error {
return flag.ErrHelp
},
Subcommands: []*ffcli.Command{
summaryCommand,
traceCommand,