From 08d2e6362972df6e399645c0ad69c7edd27d6da2 Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Thu, 26 Sep 2024 21:28:11 -0500 Subject: [PATCH] Add --version support (#32) --- cmd/root.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index 9bc1f91..2bac90d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -12,11 +12,16 @@ import ( ) var cfgFile string +var ( + gitVersion string + buildTime string +) // RootCmd represents the base command when called without any subcommands var RootCmd = &cobra.Command{ Use: "chia-tools", Short: "Collection of CLI tools for working with Chia Blockchain", + Version: fmt.Sprintf("%s (%s)", gitVersion, buildTime), } // Execute adds all child commands to the root command and sets flags appropriately.