Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Motok1 committed Oct 19, 2022
1 parent b430dd7 commit ff4f0b7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/pola/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import (
"fmt"
"log"
"os"

"github.com/nttcom/pola/internal/pkg/version"
)

func main() {
if len(os.Args) > 1 && os.Args[1] == "--version" {
fmt.Printf("alpha release.\n")
fmt.Println("pola " + version.Version())
return
}

Expand Down
8 changes: 8 additions & 0 deletions cmd/polad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package main

import (
"flag"
"fmt"
"log"
"os"
"time"
Expand All @@ -16,6 +17,7 @@ import (
"github.com/nttcom/pola/internal/config"
"github.com/nttcom/pola/internal/pkg/gobgp"
"github.com/nttcom/pola/internal/pkg/table"
"github.com/nttcom/pola/internal/pkg/version"
"github.com/nttcom/pola/pkg/logger"
"github.com/nttcom/pola/pkg/server"
)
Expand All @@ -29,6 +31,12 @@ type Flags struct {
}

func main() {

if len(os.Args) > 1 && os.Args[1] == "--version" {
fmt.Println("polad " + version.Version())
return
}

f := new(Flags)
flag.StringVar(&f.ConfigFile, "f", "polad.yaml", "Specify a configuration file")
flag.Parse()
Expand Down
11 changes: 11 additions & 0 deletions internal/pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package version

import "fmt"

const MAJOR uint = 1
const MINOR uint = 1
const PATCH uint = 0

func Version() string {
return fmt.Sprintf("%d.%d.%d", MAJOR, MINOR, PATCH)
}

0 comments on commit ff4f0b7

Please sign in to comment.