Add --pager option, don't page by default

issue #30
This commit is contained in:
Ivan Habunek 2020-09-29 11:07:20 +02:00
parent cdc0495cf1
commit f4ab045cdc
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95
3 changed files with 13 additions and 0 deletions

View File

@ -8,6 +8,7 @@ Twitch Downloader change log
* Added `--no-join` option to `download` to skip ffmpeg join (#36)
* Added `--overwrite` option to `download` to overwrite target without prompting
for confirmation (#37)
* Added `--pager` option to `videos`, don't page by default (#30)
1.11.0 (2020-09-03)
-------------------

View File

@ -65,6 +65,13 @@ def videos(args):
for video in videos["edges"]:
print_video(video["node"])
if not args.pager:
print_out(
"\n<dim>There are more videos. "
"Increase the --limit or use --pager to see the rest.</dim>"
)
break
if not has_more or not _continue():
break

View File

@ -77,6 +77,11 @@ COMMANDS = [
"choices": ["archive", "highlight", "upload"],
"default": "archive",
}),
(["-p", "--pager"], {
"help": "If there are more results than LIMIT, ask to show next page",
"action": "store_true",
"default": False,
}),
],
),
Command(