reflector.go/cmd/version.go
2018-12-26 14:12:04 -05:00

22 lines
397 B
Go

package cmd
import (
"fmt"
"time"
"github.com/lbryio/reflector.go/meta"
"github.com/spf13/cobra"
)
func init() {
var cmd = &cobra.Command{
Use: "version",
Short: "Print the version",
Run: versionCmd,
}
rootCmd.AddCommand(cmd)
}
func versionCmd(cmd *cobra.Command, args []string) {
fmt.Printf("version %s (built at %s)\n", meta.Version, meta.BuildTime.Format(time.RFC3339))
}