Skip to content

Commit

Permalink
不加参数时默认为搜索
Browse files Browse the repository at this point in the history
  • Loading branch information
0xHJK committed Aug 3, 2019
1 parent 325624f commit 19caa96
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions music_dl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ def main(
Example: music-dl -k "周杰伦"
"""
if sum([bool(keyword), bool(url), bool(playlist)]) != 1:
click.echo(_("ERROR: 必须指定搜索关键字、歌曲的URL或歌单的URL中的一个") + "\n", err=True)
ctx = click.get_current_context()
click.echo(ctx.get_help())
ctx.exit()
# click.echo(_("ERROR: 必须指定搜索关键字、歌曲的URL或歌单的URL中的一个") + "\n", err=True)
# ctx = click.get_current_context()
# click.echo(ctx.get_help())
# ctx.exit()
keyword = click.prompt(_("搜索关键字,歌名和歌手同时输入可以提高匹配(如 空帆船 朴树)") + "\n >>")

# 初始化全局变量
config.init()
Expand Down

0 comments on commit 19caa96

Please sign in to comment.