@cnbcool/cnb-api-generate 2.12.0 → 2.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/index.ts CHANGED
@@ -18,7 +18,7 @@ const program = new Command();
18
18
  program
19
19
  .name(process.env.CNB_CLI_CMD || 'cnb')
20
20
  .description('CNB OpenAPI 命令行工具')
21
- .version('<CNB_CLI_VERSION>', '-v, --version', '显示版本号')
21
+ .version('<CNB_CLI_VERSION>', '--version', '显示版本号')
22
22
  .allowUnknownOption()
23
23
  .allowExcessArguments()
24
24
  .helpOption('-h, --help', '显示帮助文档')
@@ -9,6 +9,11 @@ export function registerFallbackAction(program: Command): void {
9
9
  .argument('[module]', '模块名称')
10
10
  .argument('[tool]', '工具名称')
11
11
  .action(async (moduleArg: string | undefined, toolArg: string | undefined, opts: Record<string, any>) => {
12
+ // 顶层 -v 打印版本号(不注册为 program option,避免覆盖子命令的 -v, --verbose)
13
+ if (moduleArg === '-v') {
14
+ console.log(program.version());
15
+ return;
16
+ }
12
17
  await executeAction(moduleArg, toolArg, opts, program);
13
18
  });
14
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnbcool/cnb-api-generate",
3
- "version": "2.12.0",
3
+ "version": "2.12.2",
4
4
  "main": "./built/index.js",
5
5
  "module": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -11,8 +11,8 @@
11
11
  { "shortName": "add-assignees", "realTool": "post-issue-assignees", "description": "添加处理人", "dataTip": "--assignees username" },
12
12
  { "shortName": "upload-file", "realTool": "post-issue-comment-file-asset-upload-url", "description": "上传 issue 评论文件", "upload": true, "kind": "file", "hideInSkill": true, "dataTip": "--file 文件路径" },
13
13
  { "shortName": "upload-image", "realTool": "post-issue-comment-image-asset-upload-url","description": "上传 issue 评论图片", "upload": true, "kind": "image", "hideInSkill": true, "dataTip": "--file 图片路径" },
14
- { "shortName": "create-upload-file", "realTool": "post-asset-group", "description": "创建 issue 时上传文件", "upload": true, "kind": "file", "dataTip": "--file 文件路径" },
15
- { "shortName": "create-upload-image", "realTool": "post-asset-group", "description": "创建 issue 时上传图片", "upload": true, "kind": "image", "dataTip": "--file 图片路径" },
14
+ { "shortName": "create-upload-file", "realTool": "post-asset-group", "description": "创建 issue 时上传文件", "upload": true, "kind": "file", "hideInSkill": true, "dataTip": "--file 文件路径" },
15
+ { "shortName": "create-upload-image", "realTool": "post-asset-group", "description": "创建 issue 时上传图片", "upload": true, "kind": "image", "hideInSkill": true, "dataTip": "--file 图片路径" },
16
16
  { "shortName": "get-imgs", "realTool": "get-issue-imgs", "description": "获取 issue 图片", "repoOnly": true, "dataTip": "--img-path 图片路径" },
17
17
  { "shortName": "get-files", "realTool": "get-issue-files", "description": "获取 issue 附件", "repoOnly": true, "dataTip": "--file-path 附件路径" }
18
18
  ],