unarr/internal/cmd/version_cmd.go

22 lines
403 B
Go
Raw Permalink Normal View History

package cmd
import (
"fmt"
"runtime"
"github.com/spf13/cobra"
)
func newVersionCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "version",
Short: "Show unarr version",
Long: "Print the unarr version, operating system, and architecture.",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("unarr %s (%s/%s)\n", Version, runtime.GOOS, runtime.GOARCH)
},
}
return cmd
}