feat(etcd): add version flag

print the version and exit, very simple :)

Conflicts:
	etcd.go
This commit is contained in:
Brandon Philips 2013-10-09 14:26:49 -07:00
parent 66becddac3
commit f998a19c3d

View File

@ -31,6 +31,8 @@ var (
force bool
printVersion bool
maxSize int
snapshot bool
@ -45,6 +47,8 @@ var (
)
func init() {
flag.BoolVar(&printVersion, "version", false, "print the version and exit")
flag.BoolVar(&log.Verbose, "v", false, "verbose logging")
flag.BoolVar(&veryVerbose, "vv", false, "very verbose logging")
@ -116,6 +120,11 @@ type Info struct {
func main() {
flag.Parse()
if printVersion {
fmt.Println(releaseVersion)
os.Exit(0)
}
if cpuprofile != "" {
runCPUProfile()
}