Textualize / rich-cli

Rich-cli is a command line toolbox for fancy output in the terminal
https://www.textualize.io
MIT License
2.99k stars 77 forks source link

RFE: page yo' self (`rich --help --pager`) #42

Closed justin-f-perez closed 2 years ago

justin-f-perez commented 2 years ago

I'm getting old-man eyes and my font sizes are growing faster than my eyebrows

Could this:

rich --help --pager

display the same output as --help, but using the --pager?

willmcgugan commented 2 years ago

Maybe. I'll look in to it next release.

PS Get yourself some reading glasses. Changed my life.

nik-sm commented 2 years ago

You can make this partially work using shell process substitution (https://tldp.org/LDP/abs/html/process-sub.html) - just treating the output of rich --help like a file:

rich --pager <(rich --help)

However it doesn't preserve colors. There might be some kind of simple shell trick (or flag for rich) to print color codes alongside the text (from the rich --help), and then the outer rich --pager could interpret them. I searched a bit but couldn't find a way.