Files
go-github-dashboard/pkg/cmd/version.go
2025-05-05 17:05:43 -04:00

31 lines
569 B
Go

// pkg/cmd/version.go
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
// Version information
var (
Version = "0.1.0"
BuildDate = "unknown"
Commit = "unknown"
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number",
Long: `Print the version, build date, and commit hash.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("go-github-dashboard version %s\n", Version)
fmt.Printf("Build date: %s\n", BuildDate)
fmt.Printf("Commit: %s\n", Commit)
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}