-
Notifications
You must be signed in to change notification settings - Fork 233
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
Comments
Thanks for submitting this feature request. |
I was thinking of just a straight-forward transformation from the
current output to the equivalent JSON data structures.
So an array of hub objects, with attached metadata and each hub having
an array of port objects with attached metadata.
It is possible I've incorrectly inferred the internal data structures
from the output, but in any case I think the output should match the
internal structures.
Here is an example:
[
{
"hub": "2-1",
"usb": "2.00",
"ports":
[
{
"power": true,
"speed": "lowspeed",
"enabled": true,
"connected": true,
"vendor": 1118,
"device": 1872,
"description": "Microsoft Wired Keyboard 600",
},
...
]
},
...
]
…--
bye,
pabs
https://bonedaddy.net/pabs3/
|
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 :) |
working on this #575 , does this work for you ? |
example output |
I'm no expert on the |
Commented on #575, looks great but needs some fat trimming - both on json library used as well as size of json output. |
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/
The text was updated successfully, but these errors were encountered: