1
0
mirror of https://github.com/zu1k/nali.git synced 2025-01-22 21:29:02 +08:00
nali/cmd/info.go
2023-01-08 09:55:06 +08:00

32 lines
822 B
Go

package cmd
import (
"fmt"
"github.com/zu1k/nali/internal/constant"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
// infoCmd represents the info command
var infoCmd = &cobra.Command{
Use: "info",
Short: "get the necessary information of nali",
Long: `get the necessary information of nali`,
Example: "nali info",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Nali Version: ", constant.Version)
fmt.Println("Config Dir Path: ", constant.ConfigDirPath)
fmt.Println("DB Data Dir Path: ", constant.DataDirPath)
fmt.Println("Selected IPv4 DB: ", viper.GetString("selected.ipv4"))
fmt.Println("Selected IPv6 DB: ", viper.GetString("selected.ipv6"))
fmt.Println("Selected CDN DB: ", viper.GetString("selected.cdn"))
},
}
func init() {
rootCmd.AddCommand(infoCmd)
}