Skip to content

Commit

Permalink
fix: filter help argvs before invoking
Browse files Browse the repository at this point in the history
  • Loading branch information
RasPhilCo committed Jan 27, 2021
1 parent 48b61d3 commit 5ed3eee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ed3eee

Please sign in to comment.