Page MenuHomeFreeBSD

usbconfig: use getopt(3) for option handling
ClosedPublic

Authored by joerg on Dec 19 2021, 10:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 2 2024, 10:41 AM
Unknown Object (File)
Sep 8 2024, 2:20 PM
Unknown Object (File)
Sep 7 2024, 6:59 PM
Unknown Object (File)
Aug 31 2024, 4:13 AM
Unknown Object (File)
Aug 20 2024, 4:40 PM
Unknown Object (File)
Aug 20 2024, 4:39 PM
Unknown Object (File)
Aug 20 2024, 4:39 PM
Unknown Object (File)
Aug 20 2024, 4:22 PM
Subscribers

Details

Reviewers
hselasky
Summary

This makes option handling consistent with other utilities as well as
Posix rules. By that, it's no longer important whether option name and
its argument are separated by a space or not, so -d5.3 works the same
as -d 5.3.

Also, recognize either /dev/ugen or ugen as prefix to the -d argument.

Note that this removes the undocumented feature that allowed to
specify multiple -d n.m options interleaved with commands referring to
that particular device in a single run.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Looks good.

usr.sbin/usbconfig/usbconfig.c
579

style: I think this line should have four spaces indentation from the "} else if "

This revision is now accepted and ready to land.Dec 20 2021, 8:43 AM

Documentation fixes, mainly for -i option

  • in usage(), clearly mark -i interface as optional
  • both, -u busnum and -a devaddr are optional as well
  • various minor man page fixes
  • clearly mark those two commands that actually use -i ifaceidx
  • remove unused bitfield tag got_iface
  • fix indentation level according to review comment
This revision now requires review to proceed.Dec 20 2021, 9:24 AM

You need to bump the date of the manual page before submitting.

This revision is now accepted and ready to land.Dec 20 2021, 9:44 AM