Skip to content
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

Please add error colors ... #4

Open
unclesamwk opened this issue Oct 12, 2018 · 2 comments
Open

Please add error colors ... #4

unclesamwk opened this issue Oct 12, 2018 · 2 comments

Comments

@unclesamwk
Copy link

Hey great work.

please add additional colors for error message, eg.

thx
sam

@superatomic
Copy link
Contributor

superatomic commented Aug 28, 2023

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.

@superatomic
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants