You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
synctv/cmd/version.go

29 lines
740 B
Go

package cmd
import (
"fmt"
"runtime"
"github.com/spf13/cobra"
"github.com/synctv-org/synctv/internal/conf"
)
var VersionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of Sync TV Server",
Long: `All software has versions. This is Sync TV Server's`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("synctv %s\n", conf.Version)
fmt.Printf("- web/version: %s\n", conf.WebVersion)
fmt.Printf("- git/commit: %s\n", conf.GitCommit)
fmt.Printf("- os/platform: %s\n", runtime.GOOS)
fmt.Printf("- os/arch: %s\n", runtime.GOARCH)
fmt.Printf("- go/version: %s\n", runtime.Version())
fmt.Printf("- go/compiler: %s\n", runtime.Compiler)
},
}
func init() {
RootCmd.AddCommand(VersionCmd)
}