diff options
Diffstat (limited to 'gobgpd')
-rw-r--r-- | gobgpd/main.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gobgpd/main.go b/gobgpd/main.go index 8b292caa..0c42878f 100644 --- a/gobgpd/main.go +++ b/gobgpd/main.go @@ -1,3 +1,4 @@ +// // Copyright (C) 2014-2017 Nippon Telegraph and Telephone Corporation. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +17,7 @@ package main import ( + "fmt" "io/ioutil" "net/http" _ "net/http/pprof" @@ -37,6 +39,8 @@ import ( "github.com/osrg/gobgp/table" ) +var version = "master" + func main() { sigCh := make(chan os.Signal, 1) signal.Notify(sigCh, syscall.SIGTERM) @@ -58,12 +62,18 @@ func main() { TLS bool `long:"tls" description:"enable TLS authentication for gRPC API"` TLSCertFile string `long:"tls-cert-file" description:"The TLS cert file"` TLSKeyFile string `long:"tls-key-file" description:"The TLS key file"` + Version bool `long:"version" description:"show version number"` } _, err := flags.Parse(&opts) if err != nil { os.Exit(1) } + if opts.Version { + fmt.Println("gobgpd version", version) + os.Exit(0) + } + if opts.CPUs == 0 { runtime.GOMAXPROCS(runtime.NumCPU()) } else { |