2024-02-13 02:22:52 +08:00
|
|
|
package cmd
|
2024-02-13 00:02:55 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
|
2024-02-13 02:22:52 +08:00
|
|
|
"github.com/divyam234/teldrive/internal/config"
|
2024-02-13 00:02:55 +08:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func NewVersion() *cobra.Command {
|
|
|
|
return &cobra.Command{
|
|
|
|
Use: "version",
|
|
|
|
Short: "Check the version info",
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2024-02-13 02:22:52 +08:00
|
|
|
cmd.Printf("teldrive %s\n", config.Version)
|
2024-02-13 00:02:55 +08:00
|
|
|
cmd.Printf("- os/type: %s\n", runtime.GOOS)
|
|
|
|
cmd.Printf("- os/arch: %s\n", runtime.GOARCH)
|
|
|
|
cmd.Printf("- go/version: %s\n", runtime.Version())
|
|
|
|
return nil
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|