Skip to content

Commit 87cf1cf

Browse files
Merge pull request #1860 from rxliuli/fix/version_alias
2 parents c76822c + d9f305a commit 87cf1cf

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.changeset/every-snakes-kneel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@kubb/cli": patch
3+
---
4+
5+
Support printing version via `--version` or `-v`.

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ body:
1111
- type: input
1212
attributes:
1313
label: What version of `kubb` is running?
14-
description: Copy the output of `kubb -v`
14+
description: Copy the output of `npx kubb -v`
1515
- type: dropdown
1616
attributes:
1717
label: What kind of platform do you use?

packages/cli/src/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,18 @@ const main = defineCommand({
1313
version,
1414
description: 'Kubb generation',
1515
},
16-
async setup({ rawArgs }) {
16+
args: {
17+
version: {
18+
type: 'boolean',
19+
alias: 'v',
20+
description: 'Show version number'
21+
}
22+
},
23+
async setup({ rawArgs, args }) {
24+
if (args.version) {
25+
console.log(version);
26+
process.exit(0);
27+
}
1728
try {
1829
consola.log(gradientString(['#F58517', '#F5A217', '#F55A17'])('Kubb CLI:'))
1930

0 commit comments

Comments
 (0)