Version cmd

This commit is contained in:
AlexSSD7 2023-08-30 14:53:22 +01:00
commit 8f62831b9d
3 changed files with 21 additions and 2 deletions

17
cmd/version.go Normal file
View file

@ -0,0 +1,17 @@
package cmd
import (
"fmt"
"runtime"
"github.com/AlexSSD7/linsk/constants"
"github.com/spf13/cobra"
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "Show Linsk version.",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Linsk %v %v/%v %v", constants.Version, runtime.GOOS, runtime.GOARCH, runtime.Version())
},
}