From c42433e12fdfbaf9e85b5cb3002cb68a9c72b7ad Mon Sep 17 00:00:00 2001 From: stephen mcquay Date: Wed, 28 Feb 2018 20:41:25 -0800 Subject: [PATCH] Fail on missing args --- cmd/pm/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/pm/main.go b/cmd/pm/main.go index 5d5895e..3e77309 100644 --- a/cmd/pm/main.go +++ b/cmd/pm/main.go @@ -182,10 +182,16 @@ func main() { switch sub { case "add", "a": + if len(args) < 1 { + fatalf("missing arg\n\nusage: pm remote add []\n") + } if err := remote.Add(root, args); err != nil { fatalf("remote add: %v\n", err) } case "rm": + if len(args) < 1 { + fatalf("missing arg\n\nusage: pm remote rm []\n") + } if err := remote.Remove(root, args); err != nil { fatalf("remote remove: %v\n", err) }