代码拉取完成,页面将自动刷新
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
"gitee.com/lollipop-xyz/g7-keyauth/version"
)
var (
// pusher service config option
confType string
confFile string
confETCD string
)
var vers bool
// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "g7-keyauth",
Short: "用户中心",
Long: "用户中心",
RunE: func(cmd *cobra.Command, args []string) error {
if vers {
fmt.Println(version.FullVersion())
return nil
}
return cmd.Help()
},
}
// Execute adds all child commands to the root command sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
if err := RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(-1)
}
}
func init() {
RootCmd.PersistentFlags().StringVarP(&confType, "config-type", "t", "file", "the service config type [file/env/etcd]")
RootCmd.PersistentFlags().StringVarP(&confFile, "config-file", "f", "etc/config.toml", "the service config from file")
RootCmd.PersistentFlags().StringVarP(&confETCD, "config-etcd", "e", "127.0.0.1:2379", "the service config from etcd")
RootCmd.PersistentFlags().BoolVarP(&vers, "version", "v", false, "the g7-keyauth version")
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。