fix versioning

This commit is contained in:
Robert Kaussow 2022-04-25 12:12:17 +02:00
parent 92dd54a823
commit ee0196e378
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
1 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package main
import (
"fmt"
"os"
"github.com/sirupsen/logrus"
@ -8,14 +9,20 @@ import (
"github.com/urfave/cli/v2"
)
// Version of current build
var Version = "devel"
var (
BuildVersion = "devel"
BuildDate = "00000000"
)
func main() {
cli.VersionPrinter = func(c *cli.Context) {
fmt.Printf("%s version=%s date=%s\n", c.App.Name, c.App.Version, BuildDate)
}
app := cli.NewApp()
app.Name = "url-parser"
app.Usage = "Parse URL and shows the part of it."
app.Version = Version
app.Version = BuildVersion
app.Action = command.Run
app.Flags = globalFlags()
app.Commands = configCommands()