At times when living my life in the terminal I run many commands in quick succession that might produce a lot of output. Differencing where the output actually comes from can be tiresome. Previously I’ve done simple things like
but it’s not exactly visually striking, is it?
So I crafted a little tool that solves this problem in a better way, and it tries to be smart about it, too. By default, we try to determine the size of the terminal window to make sure the hr spans across nicely. The size of the bar can be configurable; maybe you don’t want the bar to span the entire terminal:
or maybe you want it to span the entire window, but you’d like some padding:
wouldn’t it be nice to have padding on both sides, though?
We can add a bit of color to it as well, to make it stand out more from the rest of the data on screen:
and of course the actual character that’s used to create the bar is configurable:
Here’s a screenshot of what it can look like in a chain of commands (more screenshots in the examples section, below):
-c, --char Character to use -s, --size Number of columns -pre, --pre Pad the left side with whitespace n -post, --post Pad the right side with whitespace n -fg, --fg Foreground color to use, int 0-255 -bg, --bg Background color to use, int 0-255 -b, --bold Use bold -i, --italic Use italics -u, --underline Use underline -r, --reverse Use reverse video -h, --help Display this help and exit -m, --man Display the manual and exit -v, --version Display version info and exit
Due to the configurability of hr, differencing different hr invocations from each other is no problem.
Bonus: advanced example using arithmetics, because math is hard.