Skip to content
Permalink
Browse files

Handle invalid CLI flags (#421)

Previously, the flags were not handled so the application would
Looking at the documentation for https://github.com/urfave/cli , the error is propogated up through the `app.Run` call.
Now, the error is checked before fatally logging it.

closes #420
  • Loading branch information...
mkobit authored and aelsabbahy committed May 12, 2019
1 parent 641180c commit 5b23ea2717b7e4361a10cdb6a45c9d0b50118c6a
Showing with 7 additions and 3 deletions.
  1. +7 −3 cmd/goss/goss.go
@@ -2,6 +2,7 @@ package main

import (
"fmt"
"log"
"os"
"time"

@@ -286,11 +287,11 @@ func main() {
Value: 5 * time.Second,
},
cli.StringFlag{
Name: "username, u",
Name: "username, u",
Usage: "Username for basic auth",
},
cli.StringFlag{
Name: "password, p",
Name: "password, p",
Usage: "Password for basic auth",
},
},
@@ -335,6 +336,9 @@ func main() {
},
}

app.Run(os.Args)
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}

}

0 comments on commit 5b23ea2

Please sign in to comment.
You can’t perform that action at this time.