download: put --config before the subcommand in the VPN-wrapped re-run (fixes argparse unrecognized argument)

This commit is contained in:
Konstantin Passig PC
2026-08-25 16:52:43 +02:00
parent a8568f2007
commit b5d56d4d34
+4 -2
View File
@@ -37,10 +37,12 @@ def cmd_init(args: argparse.Namespace) -> int:
def _download_argv(args: argparse.Namespace) -> list[str]:
"""Rebuild the `download` argv for the VPN-wrapped subprocess."""
argv = ["download"]
argv = []
if getattr(args, "config", None):
# --config is a parent/global option and must come before the
# subcommand, or argparse treats it as unrecognized
argv += ["--config", str(args.config)]
argv += [args.url]
argv += ["download", args.url]
if getattr(args, "quality", None):
argv += ["--quality", args.quality]
if getattr(args, "format", None):