feat: just did the stuff
This commit is contained in:
@@ -2,12 +2,30 @@ import logging
|
||||
import sys
|
||||
|
||||
from . import PKG_NAME, PKG_VERSION
|
||||
from .cache import Cache
|
||||
from .constants import LANGS
|
||||
from .factory import Factory
|
||||
from .logs import setup_logs
|
||||
from .params import parse_parameters
|
||||
from .tld_list import TLDList
|
||||
|
||||
|
||||
def main() -> int:
|
||||
params = parse_parameters(sys.argv[1:])
|
||||
setup_logs(params)
|
||||
logging.getLogger().info("%s %s", PKG_NAME, PKG_VERSION)
|
||||
with (
|
||||
Cache(filepath=params.cache_file, no_load=params.cache) as cache,
|
||||
TLDList(cache=cache, remote_uri=params.tld_list_uri) as tld_list,
|
||||
LANGS[params.lang] as word_list,
|
||||
):
|
||||
factory = Factory(tld_list=tld_list, word_list=word_list)
|
||||
logging.getLogger().info(
|
||||
"Searching %s domain%s", params.count, "s" if params.count > 1 else ""
|
||||
)
|
||||
for _ in range(params.count):
|
||||
if params.dig:
|
||||
logging.getLogger().info(factory.random_available_domain())
|
||||
else:
|
||||
logging.getLogger().info(factory.random_domain())
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user