diff --git a/.gitignore b/.gitignore index 9464b34..ac43b19 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ __pycache__ *.png log.txt -assets/auth.txt +auth.txt +assets/* .vscode .idea -venv \ No newline at end of file +venv diff --git a/lib/__init__.py b/lib/__init__.py index 9ff9acb..8d573e2 100644 --- a/lib/__init__.py +++ b/lib/__init__.py @@ -14,7 +14,9 @@ if arguments.download: api.get_pixels((1920, 1080)).save("./canvas.png") print("Canvas downloaded to ./canvas.png!") - # Don't exit + # Don't exit unless -E is used + if arguments.download_exit: + exit(0) def query_params(): diff --git a/lib/cli.py b/lib/cli.py index 3a6c257..2305711 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -133,6 +133,7 @@ def loop_validator(v: str): ) parser.add_argument( "--version", + "-v", action="store_true", default=False, help="Shows the version and exits." @@ -145,6 +146,14 @@ def loop_validator(v: str): help="Downloads the canvas to canvas.png", dest="download" ) +parser.add_argument( + "--download-canvas-exit", + "-E", + action="store_true", + default=False, + help="If -D or --download-canvas is also specified, this will exit after downloading", + dest="download_exit" +) arguments = parser.parse_args()