Skip to content

Commit

Permalink
remove the command name from commandFlags._
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Jul 20, 2020
1 parent 051f667 commit 0780fe3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/kbn-dev-utils/src/run/run_with_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ export class RunWithCommands<T> {

const commandFlagOptions = mergeFlagOptions(this.options.globalFlags, command.flags);
const commandFlags = getFlags(process.argv.slice(2), commandFlagOptions);
// strip command name plus "help" if we're actually executing the fake "help" command
if (isHelpCommand) {
commandFlags._.splice(0, 2);
} else {
commandFlags._.splice(0, 1);
}

const commandHelp = getCommandLevelHelp({
usage: this.options.usage,
globalFlagHelp: this.options.globalFlags?.help,
Expand Down

0 comments on commit 0780fe3

Please sign in to comment.