Open agoscinski opened 4 months ago
The first error is rendered by click
itself whenever an exception (of a certain type, defined by click
) is raised during the parsing of command line parameters. I personally don't think we should start messing with this just so the coloring can be more consistent tbh
I agree with you that this probably causes more work than it is worth it. I saw this package that colors the help messages of click https://github.com/click-contrib/click-help-colors/tree/master so it seems like it is not just one argument in click that can be set to change the error message style. I put priority on nice-to-have and remove that this is a bug.
This is the script
and this is how it looks like in the terminal Notice that the
Error
is colored in the second case and in the first not. The second occurrence is caused byaiida.cmdline.commands.utils.echo.echo_error
, the first one I don't know. I noticed this mainly because I wanted to track the first error message, but could not find it in the code. Also checked plumpy, but grep did not give me anything and debugging throughclick
is a bit cumbersome.I think the issue that the coloring is inconsistent is not a high-priority issue, but I was mainly interested where the first error message origins from. Is it due to the decorator arguments that passes it to
orm.querybuilder
somehow? I could not reconstruct the whole logic flow here, but I saw that in querybuilder there is something that could output part of the error message.My environment
Python version 3.11.0, Ubuntu 22.04