feat: support packing multiple packages #13

Open
Jvlegod wants to merge 1 commits from Jvlegod/go2spec:feature/pack-multiple-packages into master
Contributor

给 pack 命令新增特性, 能同时生成多个 spec, go2spec pack <xxx@version> <xxx> <xxx> ...

中间有一个pack中断则停止后面的生成.

用法.

# 单包, 自动解析 latest
go2spec pack github.com/a/pkg

# 单包, git_revision 制定版本(原本的这一块儿代码选项没动)
go2spec pack -git_revision v1.2.0 github.com/a/pkg

# 单包, 指定 v 前缀版本
go2spec pack github.com/a/pkg@v1.2.0

# 单包, 指定不带 v 的版本, 会优先找 1.2.0, 找不到再尝试 v1.2.0
go2spec pack github.com/a/pkg@1.2.0

# 多包, 都自动解析 latest
go2spec pack github.com/a/pkg github.com/b/pkg

# 多包, 每个包指定不同版本
go2spec pack github.com/a/pkg@v1.2.0 github.com/b/pkg@2.0.0

# 混用, 有的指定版本, 有的自动 latest
go2spec pack github.com/a/pkg@v1.2.0 github.com/b/pkg

# 兼容旧用法, -git_revision 作为没有 @version 的默认版本
go2spec pack -git_revision v1.2.0 github.com/a/pkg github.com/b/pkg@2.0.0 github.com/c/pkg
给 pack 命令新增特性, 能同时生成多个 spec, `go2spec pack <xxx@version> <xxx> <xxx> ...` 中间有一个pack中断则停止后面的生成. 用法. ```bash # 单包, 自动解析 latest go2spec pack github.com/a/pkg # 单包, git_revision 制定版本(原本的这一块儿代码选项没动) go2spec pack -git_revision v1.2.0 github.com/a/pkg # 单包, 指定 v 前缀版本 go2spec pack github.com/a/pkg@v1.2.0 # 单包, 指定不带 v 的版本, 会优先找 1.2.0, 找不到再尝试 v1.2.0 go2spec pack github.com/a/pkg@1.2.0 # 多包, 都自动解析 latest go2spec pack github.com/a/pkg github.com/b/pkg # 多包, 每个包指定不同版本 go2spec pack github.com/a/pkg@v1.2.0 github.com/b/pkg@2.0.0 # 混用, 有的指定版本, 有的自动 latest go2spec pack github.com/a/pkg@v1.2.0 github.com/b/pkg # 兼容旧用法, -git_revision 作为没有 @version 的默认版本 go2spec pack -git_revision v1.2.0 github.com/a/pkg github.com/b/pkg@2.0.0 github.com/c/pkg ```
Jvlegod added 1 commit 2026-07-20 05:37:16 +00:00
Jvlegod force-pushed feature/pack-multiple-packages from f5d2a42f4d to d2d09d06fd 2026-07-20 05:37:16 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u https://git.openruyi.cn/Jvlegod/go2spec feature/pack-multiple-packages:Jvlegod-feature/pack-multiple-packages
git checkout Jvlegod-feature/pack-multiple-packages
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: misaka00251/go2spec#13