diff --git a/lib/command.js b/lib/command.js index 82e744e37..2634596ad 100644 --- a/lib/command.js +++ b/lib/command.js @@ -1526,9 +1526,9 @@ Expecting one of '${allowedValues.join("', '")}'`); // Not a recognised option by this command. Might be // - a subcommand, - // - a command-argument, - // - the help option encountered after a subcommand, - // - or an option unknown to this command. + // - the help option encountered after a subcommand (considered unknown), + // - any other option unknown to this command, + // - or a command-argument. const allArgsConsumedAsOptionsSoFar = operands.length === 0 && unknown.length === 0; if (!subcommandEncountered && allArgsConsumedAsOptionsSoFar) {