Comments (2)
I've managed to solve the problem by calling get_current_context()
in the __init__()
method of the exception.
I would be willing to implement colored errors and submit a PR.
from click-help-colors.
I did some looking into this and there are some technical problems that make this difficult to implement. In theory, all that would need to be done would be to override the show()
method for click.ClickException
by either subclassing ClickException
or by monkeypatching the class itself. However, when this method it called it is impossible to get the current click.Context
with click.get_current_context()
, which is needed to see if the color
parameter is False
.
Potentially, it might be possible for HelpColorsCommand
to somehow hold on to the necessary Context
, but I need to do more research into the problem.
from click-help-colors.
Related Issues (12)
- tests missing from pypi tarball HOT 2
- help_headers_color inconsistency
- Incompatibility with newer click 8.0
- Colors are not passed to sub commands when using click-plugins
- new release with click 8 support HOT 1
- Highlighting of options, choices and metavars HOT 1
- LICENSE.txt missing from MANIFEST.in
- PEP-0561 and PEP-0484: library is missing type information (mypy) HOT 1
- Respect the NO_COLOR environment variable
- Colorize version_option
- Is there a way to use this plugin with click.MultiCommand HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from click-help-colors.