On Mon, Feb 22, 2021 at 8:50 AM John P. Linderman <jpl.jpl(a)gmail.com> wrote:
I can imagine a simple perl (or python or whatever)
script that would run
through groff input, determine which preprocessors are *actually* needed,
and set up a pipeline to run through (only) the needed preprocessors in the
proper order. I wouldn't have to tell groff what preprocessors I think are
needed, and groff wouldn't have to change (although my script would) when
another preprocessor comes into existence. Modern processors are fast
enough, and groff input small enough, that the "extra" pass wouldn't be
burdensome. And it would take the burden off me to remember exactly which
preprocessors are essential. -- jpl
Yea, that's the main benefit of extra flags to commands: you can optimize
the number of filters that data passes through, or you can do things with
'hidden state' that's hard to do in another phase of the output. ls is a
good example. ls -lt is relatively easy to do the sorting of times and the
formatting of times inside ls, but harder to do as a filter since times are
hard to sort...
Warner