Luminarys / synapse

Synapse BitTorrent Daemon
https://synapse-bt.org
ISC License
855 stars 48 forks source link

sycli list: Allow to receive input #208

Open alexherbo2 opened 3 years ago

alexherbo2 commented 3 years ago

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
evanrichter commented 3 years ago

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

alexherbo2 commented 3 years ago

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).

evanrichter commented 3 years ago

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 commented 3 years ago

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

Luminarys commented 3 years ago

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