66sys_path .append (os_path .dirname (os_path .abspath (__file__ )))
77
88# pylint: disable=C0413
9- from provider import Provider , BASE_PROVIDERS_IP , BASE_PROVIDERS_DOMAIN
9+ from provider import Provider
1010from checker import CheckDomain , CheckIP
11+ from provider_config import BASE_PROVIDERS_IP , BASE_PROVIDERS_DOMAIN
1112
1213
1314def main ():
@@ -26,17 +27,26 @@ def main():
2627 '-a' , '--add-providers' , type = str , default = '' ,
2728 help = 'Comma-separated list of additional DNS-BL provider-domains to query' ,
2829 )
30+ parser .add_argument (
31+ '-o' , '--only-providers' , type = str , default = '' ,
32+ help = 'Comma-separated list of DNS-BL provider-domains to query (ignoring the built-in default providers)' ,
33+ )
2934 parser .add_argument (
3035 '--details' , action = 'store_true' , default = False ,
3136 help = 'If the result details should be added to the output' ,
3237 )
3338 args = parser .parse_args ()
3439
35- skip_providers = args .skip_providers .split (',' )
3640 add_providers = [Provider (p ) for p in args .add_providers .split (',' )]
41+ only_providers = [Provider (p ) for p in args .only_providers .split (',' )]
42+ skip_providers = args .skip_providers .split (',' )
3743
3844 if args .ip is not None :
39- providers = BASE_PROVIDERS_IP + add_providers
45+ if len (only_providers ) > 0 :
46+ providers = only_providers
47+
48+ else :
49+ providers = BASE_PROVIDERS_IP + add_providers
4050
4151 if not args .json :
4252 print (f'Checking IP { args .ip } ..' )
@@ -45,7 +55,11 @@ def main():
4555 result = checker .check (args .ip )
4656
4757 else :
48- providers = BASE_PROVIDERS_DOMAIN + add_providers
58+ if len (only_providers ) > 0 :
59+ providers = only_providers
60+
61+ else :
62+ providers = BASE_PROVIDERS_DOMAIN + add_providers
4963
5064 if not args .json :
5165 print (f'Checking Domain { args .domain } ..' )
0 commit comments