Skip to content

Explain a possible fix for the argparse limitation with --options#249

Merged
eldipa merged 2 commits intomasterfrom
Issue-31-Enhance-Error-when-Options-Argument-is-Confused-with-Another-Flag
May 31, 2022
Merged

Explain a possible fix for the argparse limitation with --options#249
eldipa merged 2 commits intomasterfrom
Issue-31-Enhance-Error-when-Options-Argument-is-Confused-with-Another-Flag

Conversation

@eldipa
Copy link
Copy Markdown
Collaborator

@eldipa eldipa commented May 31, 2022

argparse, currently, cannot handle values for options that start with -
which also identifies other options.

So --options -foo is seen as 2 argument-less options and because
--options requires 1 argument, argparse fails.

The solution is stick the option with its argument as in --options=-foo

This commits suggests the user to do that.

Closes #31

argparse, currently, cannot handle values for options that start with -
which also identifies other options.

So --options -foo is seen as 2 argument-less options and because
--options requires 1 argument, argparse fails.

The solution is stick the option with its argument as in --options=-foo

This commits suggests the user to do that.
@eldipa eldipa added this to the 11.0.0 milestone May 31, 2022
@eldipa eldipa merged commit 7eb3c6e into master May 31, 2022
@eldipa eldipa deleted the Issue-31-Enhance-Error-when-Options-Argument-is-Confused-with-Another-Flag branch May 31, 2022 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

If the argument for the option -o begins with a minus, the argument is treated as another option instead of be treated as an argument

1 participant