aergoio/aergo

View on GitHub
cmd/aergosvr/version.go

Summary

Maintainability
A
40 mins
Test Coverage
package main

import "github.com/spf13/cobra"

var githash = "No git hash provided"

func init() {
    rootCmd.AddCommand(versionCmd)
}

var versionCmd = &cobra.Command{
    Use:   "version",
    Short: "Print the version number of Aergosvr",
    Long:  `All software has versions. This is Aergo's`,
    Args:  cobra.NoArgs,
    Run: func(cmd *cobra.Command, args []string) {
        cmd.Printf("Aergosvr %s\n", githash)
    },
}