diff --git a/main.py b/main.py deleted file mode 100644 index e0abfb8..0000000 --- a/main.py +++ /dev/null @@ -1,4 +0,0 @@ -import snapmap_archiver - -if __name__ == "__main__": - snapmap_archiver.main() diff --git a/pyproject.toml b/pyproject.toml index ab76490..a585850 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ loguru = "^0.7.2" [tool.poetry.dev-dependencies] [tool.poetry.scripts] -snapmap-archiver = "snapmap_archiver:main" +snapmap-archiver = "snapmap_archiver.__main__:main" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/snapmap_archiver/__main__.py b/snapmap_archiver/__main__.py index b167b75..9dc8ec4 100644 --- a/snapmap_archiver/__main__.py +++ b/snapmap_archiver/__main__.py @@ -4,14 +4,9 @@ from loguru import logger from loguru._logger import Logger -from snapmap_archiver import ( - DEFAULT_RADIUS, - DEFAULT_WRITE_JSON, - DEFAULT_ZOOM_DEPTH, - ISSUES_URL, - SNAP_PATTERN, - default_output_dir, -) +from snapmap_archiver import (DEFAULT_RADIUS, DEFAULT_WRITE_JSON, + DEFAULT_ZOOM_DEPTH, ISSUES_URL, SNAP_PATTERN, + default_output_dir) from snapmap_archiver.coordinates import Coordinates from snapmap_archiver.SnapmapArchiver import SnapmapArchiver @@ -124,6 +119,10 @@ def main(): Coordinates(location) for location, in (args.location if args.location else []) ] + if not valid_snap_ids and not coordinates: + logger.error('Some kind of input is required. Run [snapmap-archiver -h] for help.') + sys.exit(1) + sm_archiver = SnapmapArchiver( logger=logger, # type: ignore output_dir=args.output_dir,