From 2e9919d9ad1b2fecde0d34ec6856649baca2e26e Mon Sep 17 00:00:00 2001 From: souvik Date: Fri, 27 Aug 2021 13:40:30 +0530 Subject: [PATCH] feat: add support for version -v alias (#56) --- README.md | 2 +- src/cli.ts | 3 +++ src/help-message.tsx | 7 +------ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2985f16b901..f6c3cc776fb 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ asyncapi [options] [command] OPTIONS -h, --help display help for command ---version output the version number +-v, --version output the version number COMMANDS diff --git a/src/cli.ts b/src/cli.ts index 8f18a85a467..c9697efd2a7 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -26,6 +26,9 @@ const cli = meow({ }, help: { alias: 'h' + }, + version: { + alias: 'v' } } }); diff --git a/src/help-message.tsx b/src/help-message.tsx index 402fb397f2d..50757cc81d5 100644 --- a/src/help-message.tsx +++ b/src/help-message.tsx @@ -23,7 +23,7 @@ export class HelpMessage { readonly flags = [ this.helpFlag, - '--version, output version string' + '-v, --version output version number' ]; readonly commands: Command = { @@ -83,11 +83,6 @@ export class HelpMessageBuilder { const [alias, ...rest] = flag.split(','); const flg = rest[0]?.split(' ')[1]; const msg = rest[0]?.split(' ').splice(2, rest[0].length).join(' '); - if (alias === '--version') { - return - {alias} {rest} - ; - } return {alias},{flg} {msg} ;