prettytable-rs icon indicating copy to clipboard operation
prettytable-rs copied to clipboard

switch for parsable output

Open Licenser opened this issue 8 years ago • 3 comments

Many CLI programs use -H for headerless and -p for passable when it comes to printing tables. Reading the docs, I think that could be done by specifying a custom format, but it would be helpful to have a simple switch for those options.

Licenser avatar Jul 05 '17 12:07 Licenser

What about printing the table into CSV instead ?

phsym avatar Feb 19 '18 21:02 phsym

(Sorry for the late reply by the way)

phsym avatar Feb 19 '18 21:02 phsym

@phsym Well, still need to take care of header, no? That part can be handled with slices I believe.

Plus, parsable output usually tab separated to allow consumption from within shell scripts without thinking about quotes. Having to_csv_string shortcut similar to from_csv_string would be a fine addition to ~~my collection~~ api.

However, parsable output needed for things that usually came from the iterator, so -H can completely ignore Table and just output it itself, at least that how I've done.

andoriyu avatar Mar 01 '18 04:03 andoriyu