From e0c36ea4dddb206862b3575d9db21fbf304619c1 Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Mon, 22 Jan 2024 18:56:41 +0800 Subject: :sparkles: feat(cli): add upgrade and force options in install --- src/ipm/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ipm/__main__.py b/src/ipm/__main__.py index c732163..e19b759 100644 --- a/src/ipm/__main__.py +++ b/src/ipm/__main__.py @@ -12,10 +12,12 @@ main = typer.Typer( def install( uri: str = typer.Argument(help="Infini 包的统一资源标识符"), index: str = typer.Option(None, help="IPM 包服务器"), + upgrade: bool = typer.Option(False, "--upgrade", "-u", help="更新 Infini 包", is_flag=True), + force: bool = typer.Option(False, "--force", "-f", help="强制安装"), ): """安装一个 Infini 规则包到此计算机""" try: - api.install(uri, index, echo=True) + api.install(uri, index, upgrade=upgrade, force=force, echo=True) except IpmException as error: logger.error(error) -- cgit v1.2.3-70-g09d2