Page MenuHomeFreeBSD

usbconfig: add -l option to dump_device_desc for single line output
ClosedPublic

Authored by bz on Feb 12 2025, 11:06 PM.
Tags
None
Referenced Files
F115566923: D48974.diff
Fri, Apr 25, 10:33 AM
Unknown Object (File)
Wed, Apr 23, 3:23 PM
Unknown Object (File)
Sat, Apr 19, 8:56 PM
Unknown Object (File)
Sat, Apr 19, 2:09 PM
Unknown Object (File)
Wed, Apr 9, 3:16 AM
Unknown Object (File)
Mar 19 2025, 10:36 PM
Unknown Object (File)
Mar 10 2025, 12:13 AM
Unknown Object (File)
Mar 9 2025, 1:12 PM
Subscribers

Details

Summary

Like pciconf -l add a -l to dump_device_desc for usbconfig which will
fold most fields into a single line. We do filter out some we think
will not be interesting in this case.

While mangling with string output in ways not always anticipated when
the program was initially written this should help to parse the
available devices for programs like fwget(8). While I had this in
mind for other bits for a while I got prompted by D48678 to finally
do it.

Sponsored by: The FreebSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Feb 12 2025, 11:06 PM

just did a quick surface review, and LGTM

This revision is now accepted and ready to land.Feb 20 2025, 6:40 PM

Cool!

usr.sbin/usbconfig/usbconfig.8
75

AIUC?

79

Although, I don't think this line is necessary.

usr.sbin/usbconfig/usbconfig.8
75

AIUC? All Instantiated Use Cases?

79

I'll remove it as soon as the previous comment is clarified.

usr.sbin/usbconfig/usbconfig.8
75

Sorry, it was Am I Understanding Correctly. If this is how it works 76,77 wouldn't be needed either, I think.

usr.sbin/usbconfig/usbconfig.8
75

You mean adjust it to the following?

.It Fl l Cm dump_device_desc
Show numeral only key=value output as one long line.

I guess that'll work until -l is grown to support another command of usbconfig.
And if it does we can see again.

Simplify man page (if I got it right) as suggested by @ziaee

This revision now requires review to proceed.Feb 22 2025, 12:32 PM
bz marked 3 inline comments as done.Feb 23 2025, 9:24 PM

@ziaee are you happy with the man page now?

I accidentally misplaced my laptop charger so I can't download it to review. I don't know if it makes sense to change the list width? Seems good to me from here.

usr.sbin/usbconfig/usbconfig.8
75

If I'm understanding the usage, yes that looks great to me!

This revision is now accepted and ready to land.Feb 23 2025, 10:09 PM
bz marked an inline comment as done.Feb 23 2025, 11:53 PM