Skip to content

Commit 8b3ce7d

Browse files
committed
Feat: lookup command supports dbipCountryMMDB & ipinfoCountryMMDB
1 parent cff6c08 commit 8b3ce7d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

lookup.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
var supportedInputFormats = map[string]bool{
2222
strings.ToLower("clashRuleSet"): true,
2323
strings.ToLower("clashRuleSetClassical"): true,
24+
strings.ToLower("dbipCountryMMDB"): true,
25+
strings.ToLower("ipinfoCountryMMDB"): true,
2426
strings.ToLower("maxmindMMDB"): true,
2527
strings.ToLower("mihomoMRS"): true,
2628
strings.ToLower("singboxSRS"): true,
@@ -32,7 +34,7 @@ var supportedInputFormats = map[string]bool{
3234
func init() {
3335
rootCmd.AddCommand(lookupCmd)
3436

35-
lookupCmd.Flags().StringP("format", "f", "", "(Required) The input format. Available formats: text, v2rayGeoIPDat, maxmindMMDB, mihomoMRS, singboxSRS, clashRuleSet, clashRuleSetClassical, surgeRuleSet")
37+
lookupCmd.Flags().StringP("format", "f", "", "(Required) The input format. Available formats: text, v2rayGeoIPDat, maxmindMMDB, dbipCountryMMDB, ipinfoCountryMMDB, mihomoMRS, singboxSRS, clashRuleSet, clashRuleSetClassical, surgeRuleSet")
3638
lookupCmd.Flags().StringP("uri", "u", "", "URI of the input file, support both local file path and remote HTTP(S) URL. (Cannot be used with \"dir\" flag)")
3739
lookupCmd.Flags().StringP("dir", "d", "", "Path to the input directory. The filename without extension will be as the name of the list. (Cannot be used with \"uri\" flag)")
3840
lookupCmd.Flags().StringSliceP("searchlist", "l", []string{}, "The lists to search from, separated by comma")
@@ -168,6 +170,22 @@ func getInputForLookup(format, name, uri, dir string) lib.InputConverter {
168170
URI: uri,
169171
}
170172

173+
case strings.ToLower(maxmind.TypeDBIPCountryMMDBIn):
174+
input = &maxmind.MMDBIn{
175+
Type: maxmind.TypeDBIPCountryMMDBIn,
176+
Action: lib.ActionAdd,
177+
Description: maxmind.DescDBIPCountryMMDBIn,
178+
URI: uri,
179+
}
180+
181+
case strings.ToLower(maxmind.TypeIPInfoCountryMMDBIn):
182+
input = &maxmind.MMDBIn{
183+
Type: maxmind.TypeIPInfoCountryMMDBIn,
184+
Action: lib.ActionAdd,
185+
Description: maxmind.DescIPInfoCountryMMDBIn,
186+
URI: uri,
187+
}
188+
171189
case strings.ToLower(mihomo.TypeMRSIn):
172190
input = &mihomo.MRSIn{
173191
Type: mihomo.TypeMRSIn,

0 commit comments

Comments
 (0)