Skip to content

Commit

Permalink
chore(cli): 跳过未填写的含默认值的参数提示输入
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandaft committed Oct 2, 2022
1 parent 40db8ff commit dad4bce
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions uploader/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@

@click.group()
def cli():
"""uploader - v0.1.0"""
"""uploader - v0.1.4"""
pass


@cli.command()
@click.option("--authorization", type=str, prompt="用户 authorization", help="用户 authorization", required=True)
@click.option("--remember_mev2", type=str, prompt="用户 remember-mev2", help="用户 remember-mev2", required=True)
@click.option("--upload_path", type=str, prompt="待上传文件或目录路径", help="待上传文件或目录路径", required=True)
@click.option("--folder_name", type=str, prompt="文件夹名称", help="文件夹名称", default="")
@click.option("--title", type=str, prompt="传输标题", help="传输标题", default="")
@click.option("--message", type=str, prompt="传输描述", help="传输描述", default="")
@click.option("--valid_days", type=int, prompt="传输有效期(天)", help="传输有效期(天)", default=7, show_default=True)
@click.option("--chunk_size", type=int, prompt="分块大小(字节)", help="分块大小(字节)", default=2097152, show_default=True)
@click.option("--threads", type=int, prompt="上传并发数", help="上传并发数", default=5, show_default=True)
@click.option("--folder_name", type=str, help="文件夹名称", default="")
@click.option("--title", type=str, help="传输标题", default="")
@click.option("--message", type=str, help="传输描述", default="")
@click.option("--valid_days", type=int, help="传输有效期(天)", default=7, show_default=True)
@click.option("--chunk_size", type=int, help="分块大小(字节)", default=2097152, show_default=True)
@click.option("--threads", type=int, help="上传并发数", default=5, show_default=True)
def cow(authorization, remember_mev2, upload_path, folder_name, title, message, valid_days, chunk_size, threads):
"""CowTransfer - 奶牛快传"""
thread = CowUploader(authorization, remember_mev2, upload_path, folder_name,
Expand All @@ -35,15 +35,15 @@ def cow(authorization, remember_mev2, upload_path, folder_name, title, message,
@click.option("--client_id", type=str, prompt="client_id", help="client_id", required=True)
@click.option("--client_key", type=str, prompt="client_key", help="client_key", required=True)
@click.option("--upload_path", type=str, prompt="待上传文件或目录路径", help="待上传文件或目录路径", required=True)
@click.option("--title", type=str, prompt="分享链接的标题", help="分享链接的标题", default="untitled")
@click.option("--password", type=str, prompt="分享链接的密码", help="分享链接的密码(4位数字,默认无密码)", default="")
@click.option("--valid_days", type=int, prompt="传输有效期(天)", help="传输有效期(天)", default=7, show_default=True)
@click.option("--chunk_size", type=int, prompt="分块大小(字节)", help="分块大小(字节)", default=2097152, show_default=True)
@click.option("--threads", type=int, prompt="上传并发数", help="上传并发数", default=5, show_default=True)
@click.option("--title", type=str, help="分享链接的标题", default="untitled")
@click.option("--password", type=str, help="分享链接的密码(4位数字,默认无密码)", default="")
@click.option("--valid_days", type=int, help="传输有效期(天)", default=7, show_default=True)
@click.option("--chunk_size", type=int, help="分块大小(字节)", default=2097152, show_default=True)
@click.option("--threads", type=int, help="上传并发数", default=5, show_default=True)
def muse(client_id, client_key, upload_path, title, password, valid_days, chunk_size, threads):
"""MuseTransfer"""
thread = MuseUploader(client_id, client_key, upload_path, title,
password, valid_days, chunk_size, threads)
password, valid_days, chunk_size, threads)
if thread.start_upload():
click.echo(f"链接:{thread.upload_info.get('transfer_url')}")
else:
Expand Down

0 comments on commit dad4bce

Please sign in to comment.