From 2635ba2bc364e43e260e0f52fe6e71f60ca4ce63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Adamczak?= Date: Sat, 16 Nov 2024 01:52:21 +0100 Subject: [PATCH] Don't try loading the config file when running `--help` --- src/music_snapshot/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/music_snapshot/cli.py b/src/music_snapshot/cli.py index e66c93a..06e802b 100644 --- a/src/music_snapshot/cli.py +++ b/src/music_snapshot/cli.py @@ -2,6 +2,7 @@ import dataclasses import os +import sys from datetime import date, datetime, time, timedelta, timezone from pathlib import Path @@ -83,6 +84,9 @@ def cli(ctx: click.Context) -> None: You can then use those values in the `authorize` subcommand, which will also save the underlying data on your disk. """ + if "--help" in sys.argv[1:]: + return + if ctx.invoked_subcommand != "authorize": try: config = MusicSnapshotConfig.load_from_disk(MUSIC_SNAPSHOT_CONFIG_PATH)