Skip to content

The Command.prototype.parse() method has issues. #995

@yossan

Description

@yossan

This method has the following issues:

  • when registered subcommand, thier arguments and options isn't parsed to check valid.
  • when registered action, this.parseArgs() called subcommand without parsing their arguments and options.

As a result, this method's arguments are not evaluted correctly in subcommand.
In the following code expect to occur error: missing required argument "file" but not now.

parse
  .command('install <file>')
  .parse('node', 'main.js', 'install') // Expect error but not.

Also now the required argument will not correctly work.
Fix to fail if required arguments don't exist.

So it seems that this method should be reconsidered fundamentally.

Thank you for the wonderful library.

Related

#941

Metadata

Metadata

Assignees

Labels

bugCommander is not working as intended

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions