chore: nfctl version, check cmd
This commit is contained in:
@ -1,19 +1,30 @@
|
||||
package cmd
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
import (
|
||||
"github.com/loveuer/nf/nft/log"
|
||||
"github.com/loveuer/nf/nft/nfctl/opt"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var (
|
||||
Root = &cobra.Command{
|
||||
Use: "nfctl",
|
||||
Short: "nfctl: easy start your nf backend work",
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
if opt.Debug == true {
|
||||
log.SetLogLevel(log.LogLevelDebug)
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
initNew()
|
||||
Root.PersistentFlags().BoolVar(&opt.Debug, "debug", false, "debug mode")
|
||||
|
||||
Root.AddCommand(
|
||||
versionCmd,
|
||||
checkCmd,
|
||||
cmdNew,
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user