mse/cmd/mse: Fail on missing subcommand

This commit is contained in:
Matt Joiner 2020-11-04 16:34:31 +11:00
parent 7b2a7a667d
commit 15c8846153
1 changed files with 4 additions and 1 deletions

View File

@ -37,7 +37,7 @@ func mainErr() error {
}{
CryptoMethod: mse.AllSupportedCrypto,
}
arg.MustParse(&args)
p := arg.MustParse(&args)
if args.Dial != nil {
cn, err := net.Dial(args.Dial.Network, args.Dial.Address)
if err != nil {
@ -72,6 +72,9 @@ func mainErr() error {
}
doStreaming(rw)
}
if p.Subcommand() == nil {
p.Fail("missing subcommand")
}
return nil
}