diff --git a/STACpopulator/cli.py b/STACpopulator/cli.py index ac54176..00d8522 100644 --- a/STACpopulator/cli.py +++ b/STACpopulator/cli.py @@ -5,14 +5,13 @@ import sys from types import ModuleType import warnings -from typing import Callable from STACpopulator import __version__, implementations from STACpopulator.exceptions import STACPopulatorError from STACpopulator.log import setup_logging -def add_parser_args(parser: argparse.ArgumentParser) -> dict[str, Callable]: +def add_parser_args(parser: argparse.ArgumentParser) -> None: parser.add_argument( "--version", "-V", diff --git a/STACpopulator/implementations/CMIP6_UofT/add_CMIP6.py b/STACpopulator/implementations/CMIP6_UofT/add_CMIP6.py index 43c4808..bc0efed 100644 --- a/STACpopulator/implementations/CMIP6_UofT/add_CMIP6.py +++ b/STACpopulator/implementations/CMIP6_UofT/add_CMIP6.py @@ -9,6 +9,7 @@ from pystac.extensions.datacube import DatacubeExtension from requests.sessions import Session +from STACpopulator import cli from STACpopulator.log import add_logging_options from STACpopulator.request_utils import add_request_options, apply_request_options from STACpopulator.extensions.cmip6 import CMIP6Helper, CMIP6Properties @@ -131,8 +132,8 @@ def main(*args: str) -> int: parser = argparse.ArgumentParser() add_parser_args(parser) ns = parser.parse_args(args or None) - return runner(ns) - + ns.populator = "CMIP6_UofT" + return cli.run(ns) if __name__ == "__main__": sys.exit(main()) diff --git a/STACpopulator/implementations/DirectoryLoader/crawl_directory.py b/STACpopulator/implementations/DirectoryLoader/crawl_directory.py index fa98d2c..3bd96a8 100644 --- a/STACpopulator/implementations/DirectoryLoader/crawl_directory.py +++ b/STACpopulator/implementations/DirectoryLoader/crawl_directory.py @@ -6,6 +6,7 @@ from requests.sessions import Session +from STACpopulator import cli from STACpopulator.log import add_logging_options from STACpopulator.request_utils import add_request_options, apply_request_options from STACpopulator.input import STACDirectoryLoader @@ -72,7 +73,8 @@ def main(*args: str) -> int: parser = argparse.ArgumentParser() add_parser_args(parser) ns = parser.parse_args(args or None) - return runner(ns) + ns.populator = "DirectoryLoader" + return cli.run(ns) if __name__ == "__main__":