mirror of
https://github.com/saveweb/biliarchiver.git
synced 2024-09-19 11:05:28 -07:00
fix: show help when get
ting nothing
This commit is contained in:
parent
ba180b530f
commit
2659755fe4
@ -360,7 +360,15 @@ class URLorIntParamType(click.ParamType):
|
||||
"--favlist", help=click.style("收藏夹", fg="green"), type=URLorIntParamType("fid")
|
||||
)
|
||||
def get(**kwargs):
|
||||
if not any(kwargs.values()):
|
||||
if (
|
||||
not kwargs["favlist"]
|
||||
and not kwargs["series"]
|
||||
and not kwargs["ranking"]
|
||||
and not kwargs["up_videos"]
|
||||
and not kwargs["popular_precious"]
|
||||
and not kwargs["popular_series"]
|
||||
):
|
||||
click.echo(click.style("ERROR: 请指定获取方式。", fg="red"))
|
||||
click.echo(get.get_help(click.Context(get)))
|
||||
return
|
||||
asyncio.run(main(**kwargs))
|
||||
|
@ -39,7 +39,7 @@ def up(
|
||||
bvids: TextIOWrapper,
|
||||
by_storage_home_dir: bool,
|
||||
update_existing: bool,
|
||||
collection,
|
||||
collection: str,
|
||||
):
|
||||
from biliarchiver._biliarchiver_upload_bvid import upload_bvid
|
||||
from biliarchiver.config import config
|
||||
@ -50,11 +50,9 @@ def up(
|
||||
if "-" in bvid_with_upper_part:
|
||||
bvid = bvid_with_upper_part.split("-")[0]
|
||||
|
||||
upload_bvid(bvid, update_existing=update_existing,
|
||||
collection=collection)
|
||||
upload_bvid(bvid, update_existing=update_existing, collection=collection)
|
||||
|
||||
elif bvids:
|
||||
bvids_from_file = bvids.read().splitlines()
|
||||
for bvid in bvids_from_file:
|
||||
upload_bvid(bvid, update_existing=update_existing,
|
||||
collection=collection)
|
||||
upload_bvid(bvid, update_existing=update_existing, collection=collection)
|
||||
|
Loading…
Reference in New Issue
Block a user