feat: enhance versioning and upgrade feedback for nix installations
This commit is contained in:
@@ -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)
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user