question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnrecognizedArgumentHandling options are cheking in all commands

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
scott-xucommented, Jun 27, 2020

My PR has no API change at all. If the sub command’s UnrecognizedArgumentHandling/OptionNameValueSeparators is not set, it will inherit the setting from parent. The root command will have the default value if not been set.

1reaction
natemcmastercommented, Jun 13, 2020

I think the real fix is to adds new concept, subparsers. The current design mixes too many responsibilities into the subcommand structure. The API isn’t designed to handle parser behavior which varies from subcommand to subcommand. If someone is interested in taking up this work, let’s design some API for how to separate CommandLineApplication’s parsing responsibilities into something that could be scoped per subcommand.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Airflow "unrecognized arguments" Error
The “unrecognized arguments” error in Airflow indicates that the command line arguments you entered are not supported by the Airflow program. ...
Read more >
python - I can´t pass the arguments error: unrecognized ...
Another question: I can't understand the dest parameter; is it to create a variable with that name? #!/usr/bin/env python3 import argparse ...
Read more >
When arguments() argument is provided, unrecognized ...
I am using commander 2.9.0 (graceful-readlink 1.0.1) on node v4.4.7 (on Windows, running in MSYS2, if it matters). I run the following test...
Read more >
"unrecognized arguments" when trying to pass in a string ...
The command works outside of TF (i.e.running cmd prompt). We've tried different work arounds such as variables, environment variable, ...
Read more >
Troubleshoot CLI parsing failures - Azure Digital Twins
Learn how to diagnose and resolve parsing failures with the Azure Digital Twins CLI command set.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found