Skip to content

Commit

Permalink
Set Version info in rootcmd
Browse files Browse the repository at this point in the history
  • Loading branch information
speatzle committed Mar 26, 2024
1 parent 4975d53 commit 4a870ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,7 @@ func initConfig() {
fmt.Fprintln(os.Stderr, "Getting Private Key File Flag:", err)
}
}

func SetVersionInfo(version, commit, date string) {
rootCmd.Version = fmt.Sprintf("%s (Built on %s from Git SHA %s)", version, date, commit)
}
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package main

import "github.com/passbolt/go-passbolt-cli/cmd"
import (
"time"

"github.com/carlmjohnson/versioninfo"
"github.com/passbolt/go-passbolt-cli/cmd"
)

func main() {
cmd.SetVersionInfo(versioninfo.Version, versioninfo.Revision, versioninfo.LastCommit.Format(time.RFC3339))
cmd.Execute()
}

0 comments on commit 4a870ea

Please sign in to comment.