Move version printing to version package
Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
8f70e298bf
commit
b75455d2bd
2 changed files with 27 additions and 6 deletions
|
@ -3,7 +3,6 @@ package main
|
|||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
|
@ -34,7 +33,7 @@ func main() {
|
|||
flag.Parse()
|
||||
|
||||
if showVersion {
|
||||
printVersion(os.Stdout)
|
||||
version.PrintVersion()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -59,10 +58,6 @@ func usage() {
|
|||
flag.PrintDefaults()
|
||||
}
|
||||
|
||||
func printVersion(w io.Writer) {
|
||||
fmt.Fprintln(w, os.Args[0], version.Package, version.Version)
|
||||
}
|
||||
|
||||
func fatalf(format string, args ...interface{}) {
|
||||
fmt.Fprintf(os.Stderr, format+"\n", args...)
|
||||
usage()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue