uauth/internal/cmd/cmd.go

32 lines
517 B
Go
Raw Normal View History

2024-10-23 17:46:15 +08:00
package cmd
import (
"github.com/loveuer/nf/nft/log"
"github.com/spf13/cobra"
"uauth/internal/opt"
)
var (
Command = &cobra.Command{
Use: "uauth",
Short: "uauth: oauth v2 server",
Example: "",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if opt.Cfg.Debug {
log.SetLogLevel(log.LogLevelDebug)
}
},
}
)
func init() {
Command.PersistentFlags().BoolVar(&opt.Cfg.Debug, "debug", false, "debug mode")
initServe()
Command.AddCommand(
initServe(),
initClient(),
)
}