feat: enhance versioning and upgrade feedback for nix installations

This commit is contained in:
Karol Broda
2025-12-21 22:04:51 +01:00
parent 0252087bd0
commit b2be0df2f9
5 changed files with 312 additions and 19 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"runtime"
"github.com/fatih/color"
"github.com/spf13/cobra"
)
@@ -17,11 +18,25 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "Show version/build info",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("snitch %s\n", Version)
fmt.Printf(" commit: %s\n", Commit)
fmt.Printf(" built: %s\n", Date)
fmt.Printf(" go: %s\n", runtime.Version())
fmt.Printf(" os: %s/%s\n", runtime.GOOS, runtime.GOARCH)
bold := color.New(color.Bold)
cyan := color.New(color.FgCyan)
faint := color.New(color.Faint)
bold.Print("snitch ")
cyan.Println(Version)
fmt.Println()
faint.Print(" commit ")
fmt.Println(Commit)
faint.Print(" built ")
fmt.Println(Date)
faint.Print(" go ")
fmt.Println(runtime.Version())
faint.Print(" os ")
fmt.Printf("%s/%s\n", runtime.GOOS, runtime.GOARCH)
},
}