Fail on missing args

This commit is contained in:
Stephen McQuay 2018-02-28 20:41:25 -08:00
parent 92b937936e
commit c42433e12f
Signed by untrusted user: sm
GPG Key ID: 4E4B72F479BA3CE5

View File

@ -182,10 +182,16 @@ func main() {
switch sub { switch sub {
case "add", "a": case "add", "a":
if len(args) < 1 {
fatalf("missing arg\n\nusage: pm remote add [<uris>]\n")
}
if err := remote.Add(root, args); err != nil { if err := remote.Add(root, args); err != nil {
fatalf("remote add: %v\n", err) fatalf("remote add: %v\n", err)
} }
case "rm": case "rm":
if len(args) < 1 {
fatalf("missing arg\n\nusage: pm remote rm [<uris>]\n")
}
if err := remote.Remove(root, args); err != nil { if err := remote.Remove(root, args); err != nil {
fatalf("remote remove: %v\n", err) fatalf("remote remove: %v\n", err)
} }