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 :)
This commit is contained in:
parent
f8b0c876f7
commit
af30cb8725
9
etcd.go
9
etcd.go
@ -50,6 +50,8 @@ var (
|
|||||||
|
|
||||||
force bool
|
force bool
|
||||||
|
|
||||||
|
printVersion bool
|
||||||
|
|
||||||
maxSize int
|
maxSize int
|
||||||
|
|
||||||
snapshot bool
|
snapshot bool
|
||||||
@ -65,6 +67,8 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
flag.BoolVar(&printVersion, "version", false, "print the version and exit")
|
||||||
|
|
||||||
flag.BoolVar(&verbose, "v", false, "verbose logging")
|
flag.BoolVar(&verbose, "v", false, "verbose logging")
|
||||||
flag.BoolVar(&veryVerbose, "vv", false, "very verbose logging")
|
flag.BoolVar(&veryVerbose, "vv", false, "very verbose logging")
|
||||||
|
|
||||||
@ -162,6 +166,11 @@ var etcdStore *store.Store
|
|||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if printVersion {
|
||||||
|
fmt.Println(releaseVersion)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
if cpuprofile != "" {
|
if cpuprofile != "" {
|
||||||
runCPUProfile()
|
runCPUProfile()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user