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

     1  /*
     2   * @file
     3   * @copyright defined in aergo/LICENSE.txt
     4   */
     5  
     6  package main
     7  
     8  import "github.com/spf13/cobra"
     9  
    10  var githash = "No git hash provided"
    11  
    12  func init() {
    13  	rootCmd.AddCommand(versionCmd)
    14  }
    15  
    16  var versionCmd = &cobra.Command{
    17  	Use:   "version",
    18  	Short: "Print the version of Polaris",
    19  	Long:  `The version of Polaris is following the one of Arego`,
    20  	Args:  cobra.NoArgs,
    21  	Run: func(cmd *cobra.Command, args []string) {
    22  		cmd.Printf("Polaris %s\n", githash)
    23  	},
    24  }