aiida-core icon indicating copy to clipboard operation
aiida-core copied to clipboard

CLI: Add color flag to `verdi process list`

Open agoscinski opened this issue 2 months ago • 3 comments

Adds the flag --color/--no-color to verdi process list that colors the process state if on (default is on). Implements feature request #4955.

In principle it is not hard to make the color and symbols configurable because we could pass the config from the context ctx.obj.config. To not pollute the config with a bunch of styling variables, I would only use one variable that is referring to a separate config file with all styling variables. EDIT: (But I think there are more important things to work on for now, but I would make a new issue about it.)

I thought about doing the option like the ls command --color=always|auto|never, it adds the option to enforce the color also when piping, so in ls -l > out the out file would have the color strings. But I never have found this option very understandable. Right now it works like --color = auto and --no-color = never.

I am actually not sure how to test this meaningfully.

EDIT: the color scheme is like in the issue and also agrees with the color scheme in the plumpy doc https://plumpy.readthedocs.io/en/latest/concepts.html#process (I gu

I use click for styling since we use it for all CLI.

agoscinski avatar May 30 '24 18:05 agoscinski