summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorEmil Palm <emil@netnod.se>2019-05-10 15:11:22 +0200
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-06-03 21:25:01 +0900
commit671dc0d94ab92e2b21e4643ce930efb0df4ccc6d (patch)
tree677f3ff7a9df2bbe3468dfd5d0397c87ce11ef9e /cmd
parent3e3289448b48fbdf9cc765450bd421e3a71323b5 (diff)
Add Versioning support
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gobgp/main.go5
-rw-r--r--cmd/gobgpd/main.go5
2 files changed, 4 insertions, 6 deletions
diff --git a/cmd/gobgp/main.go b/cmd/gobgp/main.go
index 41f95ab2..079b1d4a 100644
--- a/cmd/gobgp/main.go
+++ b/cmd/gobgp/main.go
@@ -19,14 +19,13 @@ import (
"fmt"
"os"
+ "github.com/osrg/gobgp/internal/pkg/version"
"google.golang.org/grpc"
)
-var version = "master"
-
func main() {
if len(os.Args) > 1 && os.Args[1] == "--version" {
- fmt.Println("gobgp version", version)
+ fmt.Println("gobgp version", version.Version())
os.Exit(0)
}
grpc.EnableTracing = false
diff --git a/cmd/gobgpd/main.go b/cmd/gobgpd/main.go
index 015b0a4b..7ad06434 100644
--- a/cmd/gobgpd/main.go
+++ b/cmd/gobgpd/main.go
@@ -39,12 +39,11 @@ import (
"github.com/osrg/gobgp/internal/pkg/apiutil"
"github.com/osrg/gobgp/internal/pkg/config"
"github.com/osrg/gobgp/internal/pkg/table"
+ "github.com/osrg/gobgp/internal/pkg/version"
"github.com/osrg/gobgp/pkg/packet/bgp"
"github.com/osrg/gobgp/pkg/server"
)
-var version = "master"
-
func marshalRouteTargets(l []string) ([]*any.Any, error) {
rtList := make([]*any.Any, 0, len(l))
for _, rtString := range l {
@@ -132,7 +131,7 @@ func main() {
}
if opts.Version {
- fmt.Println("gobgpd version", version)
+ fmt.Println("gobgpd version", version.Version())
os.Exit(0)
}