cmd/ebitenmobile: fail earlier when a wrong subcommand is specified

Updates #2085
This commit is contained in:
Hajime Hoshi 2022-05-02 23:03:26 +09:00
parent 2c4ac5625b
commit 331ad93adf

View File

@ -92,6 +92,10 @@ func main() {
flag.Usage()
}
if args[0] != "bind" {
flag.Usage()
}
var flagset flag.FlagSet
flagset.StringVar(&buildO, "o", "", "")
flagset.StringVar(&buildGcflags, "gcflags", "", "")
@ -139,13 +143,8 @@ func main() {
log.Fatal(err)
}
switch args[0] {
case "bind":
if err := doBind(args, &flagset, buildTarget); err != nil {
log.Fatal(err)
}
default:
flag.Usage()
if err := doBind(args, &flagset, buildTarget); err != nil {
log.Fatal(err)
}
}