Skip to content

Commit

Permalink
Update application usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mtojek committed Nov 25, 2018
1 parent 1b4d62a commit c062920
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"flag"
"fmt"
"os"

"github.com/mtojek/aws-closest-region/closest"
log "github.com/sirupsen/logrus"
Expand All @@ -11,6 +12,7 @@ import (
func main() {
var verbose bool
flag.BoolVar(&verbose, "verbose", false, "verbose mode")
flag.Usage = usage
flag.Parse()
log.SetFormatter(&log.TextFormatter{
DisableLevelTruncation: true,
Expand Down Expand Up @@ -38,3 +40,8 @@ func main() {

fmt.Println(closestEndpoint)
}

func usage() {
fmt.Fprintf(flag.CommandLine.Output(), "Usage of %s <flags> [serviceName]:\n", os.Args[0])
flag.PrintDefaults()
}

0 comments on commit c062920

Please sign in to comment.