diff options
| author | 2024-01-17 08:01:57 +0800 | |
|---|---|---|
| committer | 2024-01-17 08:01:57 +0800 | |
| commit | 1066a9ee677cc6ba031bf1bed091fb72891afc44 (patch) | |
| tree | fa42f0d23156221155be3e088be01d2f7f1f15df | |
| parent | 96f5767109da53373ddc00206aeb69ed79821137 (diff) | |
| download | ipm-1066a9ee677cc6ba031bf1bed091fb72891afc44.tar.gz ipm-1066a9ee677cc6ba031bf1bed091fb72891afc44.zip | |
feat(cli): support ipm.exe
| -rw-r--r-- | pyproject.toml | 7 | ||||
| -rw-r--r-- | src/ipm/__main__.py | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/pyproject.toml b/pyproject.toml index 1b0aa5c..c9e9641 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,8 @@ name = "ipm" version = "0.1.0-alpha.2" description = "Infini Package Manager" authors = [ - {name = "苏向夜", email = "fu050409@163.com"}, + { name = "苏向夜", email = "fu050409@163.com" }, + { name = "简律纯", email = "leader@hydroroll.team" }, ] dependencies = [ "multilogging>=1.0.2", @@ -13,12 +14,14 @@ dependencies = [ ] requires-python = ">=3.10" readme = "README.md" -license = {text = "MIT"} +license = { text = "MIT" } [build-system] requires = ["pdm-backend"] build-backend = "pdm.backend" +[project.scripts] +ipm = "ipm.__main__:main" [tool.pdm] package-type = "library" diff --git a/src/ipm/__main__.py b/src/ipm/__main__.py index 9e25085..c40e86e 100644 --- a/src/ipm/__main__.py +++ b/src/ipm/__main__.py @@ -1,6 +1,6 @@ from .api import install, extract, build import argparse - +import sys def main(): parser = argparse.ArgumentParser( @@ -28,7 +28,7 @@ def main(): build_parser = subparsers.add_parser("build", help="打包 Infini 规则包") build_parser.add_argument("package", nargs="?", help="Infini 库路径", default=".") - args = parser.parse_args() + args = parser.parse_args(sys.argv[1:] or ["-h"]) if args.command == "install": install(args.uri, args.index, echo=True) |
