mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
feat(etcd): add version flag
print the version and exit, very simple :) Conflicts: etcd.go
This commit is contained in:
parent
66becddac3
commit
f998a19c3d
9
etcd.go
9
etcd.go
@ -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()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user