Greppable table output without TTY #1930
Unanswered
calebstewart
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm writing a command line interface, and would like the output with a TTY to be a
rich
table, but when piped to an external command, simply display a greppable output without headers. As an example, a table like:Would be displayed like a normal Rich table when
stdout
is a TTY, but would be written like this when the output is a "dumb" terminal or file (with a configurable separator ideally, but defaulting to something like a tab):This could be accomplished manually in the application, but it seems like possibly a useful thing to wrap into the
Table
class (obviously optionally). A very brief idea for what this /could/ look like is below (although, I can't say I'm happy with that; it's just an off the cuff example):I'm not sure if this fits or is possible with all the other formatting used in Rich tables, so if this is out of scope, then that's totally fine. No worries. Just an idea. I absolutely adore this library regardless ❤️
Beta Was this translation helpful? Give feedback.
All reactions