synapse icon indicating copy to clipboard operation
synapse copied to clipboard

sycli list: Allow to receive input

Open alexherbo2 opened this issue 4 years ago • 5 comments

It may be nice if sycli list could build an ASCII table from a JSON list.

sycli list | <filter> | sycli list

Example – Sorting:

sycli list |
jq-sort-by-name |
sycli list

Example – Grepping:

sycli list |
jq-select-one-piece-resources |
sycli list

alexherbo2 avatar Dec 04 '20 03:12 alexherbo2

cool idea, but I don't think sycli is meant to be a JSON -> ascii table tool

you could try using just jq itself like this answer

evanrichter avatar Dec 04 '20 03:12 evanrichter

Yep, I think also it is out of the scope of sycli. Just wanted to throw the idea because I actually wanted to do some filtering and it is not as easy as filtering lines with sort or grep (if we want to keep the ASCII table).

alexherbo2 avatar Dec 04 '20 03:12 alexherbo2

true, ascii tables aren't very unix like anyway. to fit in better with standard unix tools like sort/grep then we should just output tabulated data like the output of ps

evanrichter avatar Dec 04 '20 04:12 evanrichter

the change here would be pretty minimal: prettytable-rs has an undecorated format predefined

evanrichter avatar Dec 04 '20 17:12 evanrichter

Yea I'm in favor here of allowing a raw output, as noted it should be a fairly simple change.

Luminarys avatar Dec 11 '20 22:12 Luminarys