github.com/bytom/bytom@v1.1.2-0.20221014091027-bbcba3df6075/cmd/bytomd/commands/version.go (about)

     1  package commands
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/spf13/cobra"
     7  
     8  	"github.com/bytom/bytom/version"
     9  )
    10  
    11  var versionCmd = &cobra.Command{
    12  	Use:   "version",
    13  	Short: "Show version info",
    14  	Run: func(cmd *cobra.Command, args []string) {
    15  		fmt.Println(version.Version)
    16  	},
    17  }
    18  
    19  func init() {
    20  	RootCmd.AddCommand(versionCmd)
    21  }