-
Notifications
You must be signed in to change notification settings - Fork 4
How does ansiStylingArgument work #205
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
Comments
Could you please point to that statement in documentation? I see 1.x README "By default argparse will try to detect whether ANSI styling is supported" - which means
There is |
FYI when I was adding this feature initially, I looked at different existing libraries for other languages and didn't find a single approach so I combined them in a way that I though make most sense. This doesn't guarantee that detection heuristics works in all cases however so I'm open to improvements. |
One place for example is argparse/source/argparse/api/ansi.d Line 13 in b9d971a
...always... .
I think you have the best of all worlds in regards to ansi colors. (textbook quality like https://no-color.org/) Will try to debug, what exactly "does not work" for me. |
I see, that autodetect sees in my case a tty -> so it delivers true, but this is not forwarded to |
I could trace the autodetection setting a little further but somehow the
|
This means that if value for argument is missed then
This is interesting. I'd expect this unit test to fail in this case but it passes. Also there is an example that has >set NO_COLOR=1
>all_getting_started-advanced.exe aaa --color
Advanced("aaa", "some default value", 0, false, 0, 0, value1, CustomType(nan))
Unparsed args: []
Styling mode: on |
I updated now to 1.4.1 of argparse. Still my favourite library for commandline parsing!!!
I am having problems with ansiStylingArgument. For me it defaults to
autodetect
(the documentation says it should bealways
). And autodetect does not properly detect (I think), by default no colors are emitted when I test against the static auto field that I assign ansiStylingArgument to.The text was updated successfully, but these errors were encountered: