feat: just did the stuff
Python Lint CI / ruff (push) Successful in 50s
Python Lint CI / ruff-format-check (push) Successful in 49s
Python Test CI / coverage (push) Failing after 50s
Python Lint CI / ty (push) Successful in 50s

This commit is contained in:
2026-06-15 13:17:11 +02:00
parent dcfe91453d
commit a18c066f97
12 changed files with 445 additions and 277 deletions
+18
View File
@@ -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