summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
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)
}