mrz1988 / lilies

A cross-platform colored text formatting tool for the command line
MIT License
0 stars 0 forks source link

Idea for future: Colored Pipes #19

Open mrz1988 opened 5 years ago

mrz1988 commented 5 years ago

Ideally this would be a two-fold regex. Each pipe would have a series of rules that would match stdout and stderr. Can pass in a predicate (that would take the line), or a regex string as a matcher, then takes a regex matching string to color a certain part of the output. These pipes could then be used in context managers to color all output during a certain execution context for highlighting huge output.

An even further enhancement to this would be a way to detect "boundaries of output" in some way, and inject dividers like horizontal rules or something. That's something that needs to be thought out a lot though and might never be done, since I can see pipes as a way to structure output being pretty in-depth.