mirror of
https://github.com/go-i2p/go-github-dashboard.git
synced 2025-07-04 05:26:52 -04:00
basic idea...
This commit is contained in:
30
pkg/cmd/version.go
Normal file
30
pkg/cmd/version.go
Normal file
@ -0,0 +1,30 @@
|
||||
// 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)
|
||||
}
|
Reference in New Issue
Block a user