reflector.go/cmd/version.go
Alex Grintsvayg 970585c75d
slight edit
2019-06-26 11:47:53 -04:00

23 lines
394 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 %s)\n", meta.Version, meta.BuildTime.Format(time.RFC3339))
}