Closed lunarwhite closed 2 years ago
This would be a break in the current output, so we can't do that as it might break existing users.
Don't rely on this output if you wish to parse this by a tool, there are better ways of getting this information in a programmatic way.
So, sorry, I can't take this.
@gregkh Sorry for the bother, now I know your concern.
there are better ways of getting this information in a programmatic way.
Would you mind give me a hint about it? How to get these three human readable names: {class
, vendor
, product
} using usbutils? Thanks in advance
usbutils is not the tool for this, it is not designed to have the output parsed by anything else other than humans.
Use libusb, or the hw.ids database (access through systemd libraries), or just read the info directly out of /sys/ for the devices you are wanting to know.
There have been requests to make usbutils "parsable" and if it were to output something like JSON or the like, then that would be possible, but not at this point in time, sorry.
Signed-off-by: lunarwhite dwcn22@outlook.com
Description
Before:
It is confusing to use whitespace as the separator between USB
vendor
andproduct
.After:
It greatly simplifies the extraction of command output strings. If developers want to extract the
vendor
andproduct
fields, then the""
will be used as a separator.