From 6719676b6e5bd00ae5b5027318f006792be29779 Mon Sep 17 00:00:00 2001 From: Nathan Thomas Date: Mon, 13 Dec 2021 17:20:05 -0800 Subject: [PATCH] Specify downloads directory and config path in args --- rip/cli.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/rip/cli.py b/rip/cli.py index 4928bfa..5ef7881 100644 --- a/rip/cli.py +++ b/rip/cli.py @@ -62,7 +62,8 @@ class DownloadCommand(Command): "-i", description="Download items even if they have been logged in the database.", ), - option("config.*", description="Change configuration options"), + option("config", description="Path to config file.", flag=False), + option("directory", "-d", "Directory to download items into.", flag=False), ] help = ( @@ -82,14 +83,20 @@ class DownloadCommand(Command): update_check = threading.Thread(target=is_outdated, daemon=True) update_check.start() - config = Config() - path, codec, quality, no_db = clean_options( + path, codec, quality, no_db, directory, config = clean_options( self.option("file"), self.option("codec"), self.option("max-quality"), self.option("ignore-db"), + self.option("directory"), + self.option("config"), ) + config = Config(config) + + if directory is not None: + config.session["downloads"]["folder"] = directory + if no_db: config.session["database"]["enabled"] = False