CRAAPI/cmd/version.go

25 lines
384 B
Go
Raw Permalink Normal View History

2024-05-11 03:48:59 +08:00
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
func versionPrint() {
fmt.Println("CRAAPI static version: v0.2")
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of craapi",
Long: `All software has versions.`,
Run: func(cmd *cobra.Command, args []string) {
versionPrint()
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}