From 5ed3eee84d73f3c445fc64a47ccea50d5e6554d3 Mon Sep 17 00:00:00 2001 From: Philipe Navarro Date: Wed, 27 Jan 2021 10:09:33 -0800 Subject: [PATCH] fix: filter help argvs before invoking --- src/main.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.ts b/src/main.ts index d595ba927..05f5a5736 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,6 +43,12 @@ export async function run(argv = process.argv.slice(2), options?: Interfaces.Loa // display help version if applicable if (helpOverride(argv, config)) { + argv = argv.filter(arg => { + if (arg === 'help') return false + if (arg === '--help') return false + if (arg === '-h') return false + return true + }) const Help = getHelpClass(config) const help = new Help(config) const helpArgv = config.findCommand(ROOT_INDEX_CMD_ID) ? ['', ...argv] : argv