mirror of
https://github.com/nicksherron/bashhub-server.git
synced 2024-11-14 11:45:32 +08:00
25 lines
669 B
Go
25 lines
669 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/nicksherron/bashhub-server/version"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// versionCmd represents the version command
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Print the version number of generated code example",
|
|
Long: `All software has versions. This is generated code example`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Println("Build Date:", version.BuildDate)
|
|
fmt.Println("Git Commit:", version.GitCommit)
|
|
fmt.Println("Version:", version.Version)
|
|
fmt.Println("Go Version:", version.GoVersion)
|
|
fmt.Println("OS / Arch:", version.OsArch)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(versionCmd)
|
|
}
|