|
@@ -2,6 +2,7 @@ package cmd
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
"fmt"
|
|
"fmt"
|
|
|
|
|
+ "github.com/certusone/wormhole/bridge/pkg/version"
|
|
|
"os"
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/cobra"
|
|
@@ -20,6 +21,15 @@ var rootCmd = &cobra.Command{
|
|
|
Short: "Wormhole bridge server",
|
|
Short: "Wormhole bridge server",
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// Top-level version subcommand
|
|
|
|
|
+var versionCmd = &cobra.Command{
|
|
|
|
|
+ Use: "version",
|
|
|
|
|
+ Short: "Display binary version information",
|
|
|
|
|
+ Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
|
+ fmt.Println(version.Version())
|
|
|
|
|
+ },
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
|
|
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
|
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
|
|
func Execute() {
|
|
func Execute() {
|
|
@@ -37,6 +47,7 @@ func init() {
|
|
|
rootCmd.AddCommand(guardiand.KeygenCmd)
|
|
rootCmd.AddCommand(guardiand.KeygenCmd)
|
|
|
rootCmd.AddCommand(guardiand.AdminCmd)
|
|
rootCmd.AddCommand(guardiand.AdminCmd)
|
|
|
rootCmd.AddCommand(guardiand.TemplateCmd)
|
|
rootCmd.AddCommand(guardiand.TemplateCmd)
|
|
|
|
|
+ rootCmd.AddCommand(versionCmd)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// initConfig reads in config file and ENV variables if set.
|
|
// initConfig reads in config file and ENV variables if set.
|