diff --git a/lookup.go b/lookup.go index 47ef55edde5..442229c7a44 100644 --- a/lookup.go +++ b/lookup.go @@ -21,6 +21,8 @@ import ( var supportedInputFormats = map[string]bool{ strings.ToLower("clashRuleSet"): true, strings.ToLower("clashRuleSetClassical"): true, + strings.ToLower("dbipCountryMMDB"): true, + strings.ToLower("ipinfoCountryMMDB"): true, strings.ToLower("maxmindMMDB"): true, strings.ToLower("mihomoMRS"): true, strings.ToLower("singboxSRS"): true, @@ -32,7 +34,7 @@ var supportedInputFormats = map[string]bool{ func init() { rootCmd.AddCommand(lookupCmd) - lookupCmd.Flags().StringP("format", "f", "", "(Required) The input format. Available formats: text, v2rayGeoIPDat, maxmindMMDB, mihomoMRS, singboxSRS, clashRuleSet, clashRuleSetClassical, surgeRuleSet") + lookupCmd.Flags().StringP("format", "f", "", "(Required) The input format. Available formats: text, v2rayGeoIPDat, maxmindMMDB, dbipCountryMMDB, ipinfoCountryMMDB, mihomoMRS, singboxSRS, clashRuleSet, clashRuleSetClassical, surgeRuleSet") 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)") 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)") 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 { URI: uri, } + case strings.ToLower(maxmind.TypeDBIPCountryMMDBIn): + input = &maxmind.MMDBIn{ + Type: maxmind.TypeDBIPCountryMMDBIn, + Action: lib.ActionAdd, + Description: maxmind.DescDBIPCountryMMDBIn, + URI: uri, + } + + case strings.ToLower(maxmind.TypeIPInfoCountryMMDBIn): + input = &maxmind.MMDBIn{ + Type: maxmind.TypeIPInfoCountryMMDBIn, + Action: lib.ActionAdd, + Description: maxmind.DescIPInfoCountryMMDBIn, + URI: uri, + } + case strings.ToLower(mihomo.TypeMRSIn): input = &mihomo.MRSIn{ Type: mihomo.TypeMRSIn,