-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brackets around optional positional args and options are a different color #100
Comments
This is not "intentional" but rather a known issue. I ignored it because it requires some tedious metavar parsing and special casing argparse internals. It gets more complicated with other |
Sorry, I missed the first issue when I opened mine: #59. If this is difficult to fix, and especially if the fix would be fragile, maybe it is not worth it. (At least not until argparse is fixed.) A note in the readme explaining the behavior may suffice. The person who opened the first issue was also confused about whether the difference was intentional, and a note would help with such confusion. I'd add a note even if you intended to fix this later. |
No worries. Yes this is the one.
I might be able to handle the positional arguments brackets without hitting the edge cases of argparse. However adding a style for the symbols as requested in the linked issue is more complicated. |
Only color the metavar, not the symbols surrounding, it for positional arguments in the usage. This makes positional arguments style more consistent with optional arguments. Fixes #100
I get a help message like this from the code below.
The square brackets around the optional positional argument are red, while those around the options are not. I am not sure whether this is intentional, but it looks incorrect. I would expect all sets of brackets to be the same color (default, not red in this example).
The text was updated successfully, but these errors were encountered: