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
Unknown Object (File)
Mon, Mar 10, 12:13 AM
Unknown Object (File)
Sun, Mar 9, 1:12 PM
Unknown Object (File)
Fri, Mar 7, 9:02 PM
Unknown Object (File)
Fri, Mar 7, 2:42 PM
Unknown Object (File)
Fri, Mar 7, 3:57 AM
Unknown Object (File)
Wed, Mar 5, 6:35 PM
Unknown Object (File)
Mon, Mar 3, 3:31 AM
Unknown Object (File)
Mon, Feb 24, 1:00 AM
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.Thu, Feb 20, 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.Sat, Feb 22, 12:32 PM
bz marked 3 inline comments as done.Sun, Feb 23, 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.Sun, Feb 23, 10:09 PM
bz marked an inline comment as done.Sun, Feb 23, 11:53 PM