2024-07-12 16:00:15 +08:00
|
|
|
package cmd
|
|
|
|
|
2024-07-14 17:26:48 +08:00
|
|
|
import (
|
|
|
|
"github.com/loveuer/nf/nft/log"
|
|
|
|
"github.com/loveuer/nf/nft/nfctl/opt"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
2024-07-12 16:00:15 +08:00
|
|
|
|
|
|
|
var (
|
|
|
|
Root = &cobra.Command{
|
|
|
|
Use: "nfctl",
|
|
|
|
Short: "nfctl: easy start your nf backend work",
|
2024-07-14 17:26:48 +08:00
|
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
|
|
if opt.Debug == true {
|
|
|
|
log.SetLogLevel(log.LogLevelDebug)
|
|
|
|
}
|
|
|
|
},
|
2024-07-12 16:00:15 +08:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
initNew()
|
2024-07-14 17:26:48 +08:00
|
|
|
Root.PersistentFlags().BoolVar(&opt.Debug, "debug", false, "debug mode")
|
2024-07-12 16:00:15 +08:00
|
|
|
|
|
|
|
Root.AddCommand(
|
|
|
|
versionCmd,
|
2024-07-14 17:26:48 +08:00
|
|
|
checkCmd,
|
2024-07-12 16:00:15 +08:00
|
|
|
cmdNew,
|
|
|
|
)
|
|
|
|
}
|