diff options
| author | 2024-01-22 18:56:41 +0800 | |
|---|---|---|
| committer | 2024-01-22 18:56:41 +0800 | |
| commit | e0c36ea4dddb206862b3575d9db21fbf304619c1 (patch) | |
| tree | 760ec2eeb0a490440eaf769d64010253202c2b10 /src | |
| parent | 11dce455820f7817cc1c7bf1eadcb7187a341911 (diff) | |
| download | ipm-e0c36ea4dddb206862b3575d9db21fbf304619c1.tar.gz ipm-e0c36ea4dddb206862b3575d9db21fbf304619c1.zip | |
:sparkles: feat(cli): add upgrade and force options in install
Diffstat (limited to 'src')
| -rw-r--r-- | src/ipm/__main__.py | 4 |
1 files changed, 3 insertions, 1 deletions
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) |
