前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
package cmd import ( "fmt"
"github.com/phodal/coca/cmd/config"
"github.com/spf13/cobra" ) func init() {
versionCmd.SetOut(output)
rootCmd.AddCommand(versionCmd) } var versionCmd = &cobra.Command{ Use: "version",
Short: "version",
Run: func(cmd *cobra.Command, args []string) {
fmt.Fprintf(output, "Coca Version: " + config.VERSION + " -- HEAD \n")
}, }