From 15c8846153fb531ff40d139a5d20b8267b7153e7 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 4 Nov 2020 16:34:31 +1100 Subject: [PATCH] mse/cmd/mse: Fail on missing subcommand --- mse/cmd/mse/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mse/cmd/mse/main.go b/mse/cmd/mse/main.go index c4311ca3..2d90398a 100644 --- a/mse/cmd/mse/main.go +++ b/mse/cmd/mse/main.go @@ -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 }