Or is there maybe a way to set the pager for all help related queries to some command? I’m using bat and would like to pipe all --help through | bat --language=help by default for the syntax highlighting and colored output… Or if you know a lower effort way to color the output of --help let me know.

  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    4 hours ago

    Frankly, I would be surprised, if anything uses groff for displaying --help, unless it shows the man page for that.
    The most basic implementation of --help is a manually formatted multi-line string written into the source code, which gets printed as-is.
    For dynamic layouting, you do need more logic, but rendering it to groff source code first does not make that easier. For tabbing, you print an appropriate number of \t.