Skip to content

Commit bed4dda

Browse files
committed
Add version string
1 parent 7c3ba80 commit bed4dda

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

cmd/root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ func init() {
4545
rootCmd.AddCommand(&lastSeenCmd)
4646
}
4747

48-
func Execute() {
48+
func Execute(version string) {
49+
rootCmd.Version = version
4950
if err := rootCmd.Execute(); err != nil {
5051
os.Exit(1)
5152
}

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package main
22

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

5+
var version string
6+
57
func main() {
6-
cmd.Execute()
8+
cmd.Execute(version)
79
}

0 commit comments

Comments
 (0)