Unified handling of printing versions of programs (--version). Setting version to 0.5

This commit is contained in:
Sascha L. Teichmann
2015-07-26 22:04:16 +02:00
parent f6b5f9ce97
commit 62a53dc26b
6 changed files with 44 additions and 3 deletions

View File

@ -98,6 +98,7 @@ func main() {
dstBackend string
srcInterleaved bool
dstInterleaved bool
version bool
)
flag.Usage = usage
@ -118,9 +119,14 @@ func main() {
"Should dest database be interleaved?")
flag.BoolVar(&dstInterleaved, "di", true,
"Should source database be interleaved? Shorthand")
flag.BoolVar(&version, "version", false, "Print version and exit.")
flag.Parse()
if version {
common.PrintVersionAndExit()
}
if flag.NArg() < 2 {
log.Fatal("Missing source and/or destination database.")
}