2018-08-15 16:34:50 +02:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2018-08-30 20:41:50 +02:00
|
|
|
"fmt"
|
|
|
|
"time"
|
2018-08-15 16:34:50 +02:00
|
|
|
|
|
|
|
"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) {
|
2018-12-25 21:45:11 +01:00
|
|
|
fmt.Printf("version %s (built at %s)\n", meta.Version, meta.BuildTime.Format(time.RFC3339))
|
2018-08-15 16:34:50 +02:00
|
|
|
}
|