Better usage message for mtredisalize

This commit is contained in:
Sascha L. Teichmann 2014-09-07 15:02:39 +02:00
parent cbc5ed0c6c
commit 70e8d5a548

View File

@ -20,6 +20,13 @@ const (
GCDuration = "24h"
)
func usage() {
fmt.Fprintf(os.Stderr,
"Usage: %s [<options>] <database>\n", os.Args[0])
fmt.Fprintln(os.Stderr, "Options:")
flag.PrintDefaults()
}
func main() {
var (
@ -32,6 +39,8 @@ func main() {
gcDuration string
)
flag.Usage = usage
flag.IntVar(&port, "port", 6379, "port to bind")
flag.StringVar(&driver, "driver", "leveldb", "type of database (leveldb, sqlite)")
flag.StringVar(&host, "host", "", "host to bind")