Skip to content

Commit

Permalink
Adds -h --help flag for showing usage. #5
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariano Gappa committed Feb 26, 2017
1 parent ebcc93d commit 54626e7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"bufio"
"flag"
"fmt"
"io"
"log"
Expand All @@ -19,7 +20,18 @@ type database struct {
Pass string
}

var help = flag.Bool("help", false, "shows usage")

func init() {
flag.BoolVar(help, "h", false, "shows usage")
}

func main() {
flag.Parse()
if *help {
usage("")
}

databases := mustReadDatabasesConfigFile()

if len(os.Args[1:]) == 0 {
Expand Down

0 comments on commit 54626e7

Please sign in to comment.