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: sm
GPG Key ID: 4E4B72F479BA3CE5
1 changed files with 6 additions and 0 deletions

View File

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