github.com/aergoio/aergo@v1.3.1/cmd/aergosvr/version.go (about)

     1  package main
     2  
     3  import "github.com/spf13/cobra"
     4  
     5  var githash = "No git hash provided"
     6  
     7  func init() {
     8  	rootCmd.AddCommand(versionCmd)
     9  }
    10  
    11  var versionCmd = &cobra.Command{
    12  	Use:   "version",
    13  	Short: "Print the version number of Aergosvr",
    14  	Long:  `All software has versions. This is Aergo's`,
    15  	Args:  cobra.NoArgs,
    16  	Run: func(cmd *cobra.Command, args []string) {
    17  		cmd.Printf("Aergosvr %s\n", githash)
    18  	},
    19  }