aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--pyproject.toml7
-rw-r--r--src/ipm/__main__.py4
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)