Center-for-Research-Libraries / crl-serials-validator

Validate bibliographic and holdings data for shared print.
GNU General Public License v3.0
0 stars 1 forks source link

colorize command line output #23

Closed AndyElliottCRL closed 2 years ago

AndyElliottCRL commented 3 years ago

Specifics TBA but even before a GUI is ready we should be able to make the command line interface more user friendly by using colors and highlighting. Adding now as placeholder/don't forget for future.

nflorin commented 3 years ago

There are two questions here: what to do and how to do it. The what is hard, so a note on the how. The options seem to be:

termcolor is the most frequently suggested. It seems stable, is well documented, and worked in my tests, but it also hasn't been updated in a decade. I think colorama is mainly for Windows. sty says it works on *nix and recent Windows Terminal installs. I'm not going to roll my own.

All of this is to say it looks like we'll be using termcolor.

nflorin commented 3 years ago

Also putting this as low priority. I think we need to either commit to a GUI or commit to a fuller command line version. So I'm not going to throw a lot of effort at either a GUI or a prettier command line until we make a decision one way or another.

nflorin commented 3 years ago

I did a test of this for the file location command line outputs from issue #26 . It uses termcolor, and then also imports colorama to suppress ANSI codes that pop up on the basic Windows command line and a couple of other places. Here's the output on cmd.exe under Windows 10:

colors

Not amazing, but fine.

I'm going to keep a list of environments where the color output works and where it doesn't work in the next two comments.

nflorin commented 3 years ago

Command line colors tested and working on:

nflorin commented 3 years ago

Command line colors tested and not working on:

nflorin commented 3 years ago

I changed the blue to cyan and put the red on a white background to make the output readable on Powershell. That will be enough for now. Here it is on cmd.exe: colors

nflorin commented 2 years ago

Most of the terminal interface has some colorizing to it. Still need to colorize the output of the quick scan and the output of the main run itself.

nflorin commented 2 years ago

The current main menu (in VS Code's built in terminal under Linux):

Screenshot_2022-01-06_16-53-31

nflorin commented 2 years ago

Everything has at least preliminary coloring. I'll update as needed, but it should be good for now.