Skip to content

UnrecognizedArgumentHandling options are cheking in all commands #370

@danielmeza

Description

@danielmeza

Describe the bug
Whe an app has sub commands like
app
|-> subcommandA
|-> subcommandB

if subcommand A has UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.StopParsingAndCollect the app will throw and UnrecognizedCommandParsingException when I run app subcommandB --nissingParameter because subcommandB not allow unrecogized aruguments.

To Reproduce
Create the followin structure
app
|-> subcommandA
|-> subcommandB

Set UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.StopParsingAndCollect to
app, subcommandA and let subcommandB without UnrecognizedArgumentHandling option.

Then run app subcommandA --missingArg
You will see an UnrecognizedCommandParsingException
Expected behavior
With he following app structure:
app
|-> subcommandA
|-> subcommandB

where subcommandA has UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.StopParsingAndCollect then when a call to
app subcommandA the app should run the command not mater if subcommandB has not UnrecognizedArgumentHandling

In other words we should not check that if any command nas not UnrecognizedArgumentHandling we should only check if the matching command has the correct UnrecognizedArgumentHandling value

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclosed-resolvedThis issue is closed because the work done to resolve it is complete.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions