mirror of
https://github.com/go-i2p/go-github-dashboard.git
synced 2025-06-09 18:53:55 -04:00
31 lines
569 B
Go
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)
|
|
}
|