Add -v / --version command and appropriate build flags.

This commit is contained in:
2021-05-09 11:40:36 +01:00
parent 8bbde1f600
commit cbe73e16db
5 changed files with 22 additions and 4 deletions
+7 -2
View File
@@ -32,8 +32,9 @@ import (
)
var (
err error
repo *Setup
err error
repo *Setup
PKG_VERSION string
)
type Wording struct {
@@ -177,6 +178,10 @@ func (s *Setup) getSemver() string {
}
func main() {
if varShowVersion {
fmt.Println("semver-gen", PKG_VERSION, "\tMore information: https://github.com/lukaszraczylo/semver-generator")
return
}
if repo.Generate {
err := repo.ReadConfig(repo.LocalConfigFile)
if err != nil {