Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increasing transmission-remote -l parsability #2299

Closed
q3cpma opened this issue Dec 10, 2021 · 4 comments · Fixed by #3819
Closed

Increasing transmission-remote -l parsability #2299

q3cpma opened this issue Dec 10, 2021 · 4 comments · Fixed by #3819

Comments

@q3cpma
Copy link

q3cpma commented Dec 10, 2021

Hello.

Parsing the output of transmission-remote -l is a pain because:

  • The current way of parsing "correctly" is based on column counting, and doesn't work when the ratio overflows (which is often).
  • Using space as a delimiter doesn't work because some fields like "Have" may or may not contain a space.

Would a patch adding a --list-machine to use a tabulation between each field be accepted?

@xavery
Copy link
Contributor

xavery commented Dec 12, 2021

I don't mean to sound disrespectful, but what's the use case where parsing a program's output is preferable to just using the JSON output via the RPC interface? To use transmission-remote, your session's RPC interface must be available and you must have the correct credentials anyway - might just as well use it directly.

@valcomm
Copy link

valcomm commented Dec 12, 2021

Let me try to answer why not RPC interface. To use RPC there are requirements that make requests by command line utility very hard. For example: authorization headers, tag value, token (which forces to actually do two requests).
That makes RPC interface available only for someone who knows programming languages with a working library.

I needed more info than transmission-remote provides and I had to write my own RPC library for the language I know.
But still I use transmission-remote and I would like to ask some modification for it.
How about an additional switch that would print returned JSON to STDOUT? Then people that need their own processing/displaying could use some JSON filtering/processing command line tools (e. g. jq).
Using \t instead of " " is just a small step to the flexibility/power that would be available with my suggestion. And it's not a huge change.

@q3cpma
Copy link
Author

q3cpma commented Dec 14, 2021 via email

@ckerr
Copy link
Member

ckerr commented Jan 16, 2022

Would a patch adding a --list-machine to use a tabulation between each field be accepted?

A patch to add this feature would be fine. "Would a patch be accepted" depends on more than one factor though, e.g. if the patch is 2000 LOC and leaks like crazy I'll send it back for revision 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

5 participants