24 lines
371 B
Go
24 lines
371 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/spf13/cobra"
|
|
"hy2xs-admin/model/constant"
|
|
)
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Show version",
|
|
Long: "Show version.",
|
|
Run: runVersion,
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(versionCmd)
|
|
}
|
|
|
|
func runVersion(cmd *cobra.Command, args []string) {
|
|
fmt.Println("HY2XS admin version", constant.Version)
|
|
}
|
|
|