Skip to content

[7.x] Parser errors are ignored when subcommands are defined #794

@lhecker

Description

@lhecker

As I already mentioned, the 7.x branch currently has a serious bug: Errors returned by yargs-parser are simply ignored if a subcommand is defined and used. This means that if one of your coerce methods throws an error it will silently be ignored.

The reason for this can be found here if you search for the 3 invocations of _parseArgs(null, null, true). Since _skipValidation is set to true this essential block of code is never executed. I opened this issue, because I wasn't really sure how to correctly solve this problem.

I believe the correct solution though is to move this line up right below this line, since a parser error is not a validation error, right?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions