def discover_plugins(dirs):
    # Scan all subdirectories recursively.
    for path in _iter_plugin_files(dirs):
        filename = op.basename(path)
        subdir = op.dirname(path)
        modname, ext = op.splitext(filename)
        file, path, descr = imp.find_module(modname, [subdir])
        if file:
            # Loading the module registers the plugin in
            # IPluginRegistry.
            try:
                mod = imp.load_module(modname, file, path, descr)  # noqa
            except Exception as e:  # pragma: no cover
                logger.exception(e)
            finally:
                file.close()
    return IPluginRegistry.plugins
Just wrap add_domains in argparseese.
dataset/ETHPy150Open kwikteam/phy/phy/utils/plugin.py/discover_plugins--crossover with--dataset/ETHPy150Open letsencrypt/letsencrypt/certbot/cli.py/_DomainsAction.__call__