This commit is contained in:
Matthew Huxtable 2024-04-27 14:13:20 +09:00 committed by GitHub
commit 523fb0f379
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import (
"context"
"crypto/sha256"
"encoding/json"
"errors"
"flag"
"fmt"
"log"
@ -216,6 +217,14 @@ func main() {
}
if err := root.Parse(os.Args[1:]); err != nil {
if noexec := (ffcli.NoExecError{}); errors.As(err, &noexec) {
if args := noexec.Command.FlagSet.Args(); len(args) > 0 {
log.Fatalf("invalid subcommand %s, see -help for available subcommands", args[0])
} else {
log.Fatal("missing subcommand, see -help for available subcommands")
}
}
log.Fatal(err)
}