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

JSON output option #124

Open
pabs3 opened this issue Nov 15, 2018 · 8 comments
Open

JSON output option #124

pabs3 opened this issue Nov 15, 2018 · 8 comments

Comments

@pabs3
Copy link

pabs3 commented Nov 15, 2018

The uhubctl output currently requires custom parsing in order to use it in scripts. It would be nice to have an option for JSON output so that scripts can just use standard JSON parsing libraries to turn the output into a native data structure for their language.

BTW: I heard about uhubctl from this post:

https://joeyh.name/blog/entry/usb_drives_with_no_phantom_load/

@mvp
Copy link
Owner

mvp commented Nov 15, 2018

Thanks for submitting this feature request.
Do you have specific output format in mind? It would be helpful if you can propose one.
It should not be difficult to add -j (--json) option for json output, but we need to create stable and perhaps extensible output convention.

@pabs3
Copy link
Author

pabs3 commented Nov 15, 2018 via email

@mvp
Copy link
Owner

mvp commented Nov 15, 2018

Thanks for insight, I like the idea. I will try to implement this soon, but it will require quite a rewrite for all reporting functions. It may take a while to do it, but at least it will justify making new official release :)

@benroeder
Copy link

working on this #575 , does this work for you ?

@benroeder
Copy link

example output
example_json_output.json

@pabs3
Copy link
Author

pabs3 commented Aug 3, 2024

I'm no expert on the uhubctl internals or current output, but this proposed JSON output example looks good to me.

@mvp
Copy link
Owner

mvp commented Aug 5, 2024

Commented on #575, looks great but needs some fat trimming - both on json library used as well as size of json output.

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

No branches or pull requests

4 participants