feature request: custom column alignments
Currently anything that starts with a number is padded left and thus right-aligned. This causes irregular output when a column containing strings happens to contain a string starting with decimal digits.
It would be good to be able to specify alignment for the entire column, for when the alignment type is known beforehand.
Needed to solve https://github.com/cockroachdb/cockroach/issues/10042.
This can easily be fixed. My plan is to use regex to check but would this not be too slow ? Do you have a better solution ?
Yes do not use regexps as this indeed would be too slow.
What about a new API next to SetHeader called SetColumnAlignment, taking an array of alignment characters, one per column. Then reuse the specified alignment, and only try to autodetect if no alignment was specified.