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)
Feb 11 2024, 5:15 AM
Unknown Object (File)
Jan 31 2024, 2:26 AM
Unknown Object (File)
Jan 1 2024, 11:35 AM
Unknown Object (File)
Dec 20 2023, 6:26 AM
Unknown Object (File)
Nov 5 2023, 1:46 PM
Unknown Object (File)
Oct 4 2023, 12:43 PM
Unknown Object (File)
Apr 2 2023, 5:32 PM
Unknown Object (File)
Mar 22 2023, 6:18 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