Add --dry-run option

This commit is contained in:
Ryabin Sergey 2023-11-30 18:15:55 +01:00 committed by Ivan Habunek
parent 9685ea6a36
commit 65bf6a2b99
2 changed files with 9 additions and 1 deletions

View File

@ -255,7 +255,9 @@ def _download_clip(slug: str, args) -> None:
print_out("<dim>Selected URL: {}</dim>".format(url))
print_out("<dim>Downloading clip...</dim>")
download_file(url, target)
if (args.dry_run is False):
download_file(url, target)
print_out("Downloaded: <blue>{}</blue>".format(target))

View File

@ -240,6 +240,12 @@ COMMANDS = [
"nargs": "?",
"const": 0
}),
(["-d", "--dry-run"], {
"help": "argument provides users with a simulation mode, them to "
"preview the download process without actually downloading any files",
"action": "store_true",
"default": False,
}),
],
),
Command(