Skip to content

Commit

Permalink
Add version string
Browse files Browse the repository at this point in the history
  • Loading branch information
dsh2dsh committed Apr 23, 2024
1 parent 7c3ba80 commit bed4dda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ func init() {
rootCmd.AddCommand(&lastSeenCmd)
}

func Execute() {
func Execute(version string) {
rootCmd.Version = version
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}
Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package main

import "github.com/dsh2dsh/check_syncthing/cmd"

var version string

func main() {
cmd.Execute()
cmd.Execute(version)
}

0 comments on commit bed4dda

Please sign in to comment.