Page MenuHomeFreeBSD

usbconfig: use getopt(3) for option handling
ClosedPublic

Authored by joerg on Dec 19 2021, 10:58 PM.
Tags
None
Referenced Files
F173678676: D33579.id.diff
Sun, Sep 27, 4:25 PM
F173614660: D33579.id100331.diff
Sun, Sep 27, 4:59 AM
Unknown Object (File)
Sun, Sep 27, 3:39 AM
Unknown Object (File)
Wed, Sep 23, 7:57 PM
Unknown Object (File)
Tue, Sep 22, 11:46 PM
Unknown Object (File)
Aug 28 2026, 1:16 PM
Unknown Object (File)
Aug 27 2026, 5:52 PM
Unknown Object (File)
Jul 27 2026, 4:14 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