userspace: remove vestigial '?' cases from top-level getopt(3) loops
authorcheloha <cheloha@openbsd.org>
Sun, 4 Dec 2022 23:50:45 +0000 (23:50 +0000)
committercheloha <cheloha@openbsd.org>
Sun, 4 Dec 2022 23:50:45 +0000 (23:50 +0000)
commitd7259957e8a5d4370d76bfccd4a30d5d1fe80f38
treeceef9454802bac1be227c1166a79a261add561c0
parent69436ac82db503634bbcc6a031a5b7aaebc100e8
userspace: remove vestigial '?' cases from top-level getopt(3) loops

getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.  Hence, remove all the redundant "case '?':" lines.

Prompted by dlg@.  With help from dlg@ and millert@.

Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2
ok naddy@ millert@ dlg@
90 files changed:
bin/pax/options.c
games/robots/main.c
regress/lib/libc/db/dbtest.c
regress/lib/libc/regex/main.c
regress/lib/libpthread/switch/switch.c
regress/lib/libutil/fmt_scaled/fmt_test.c
sbin/disklabel/disklabel.c
sbin/dmesg/dmesg.c
sbin/dumpfs/dumpfs.c
sbin/growfs/growfs.c
sbin/isakmpd/isakmpd.c
sbin/mount/mount.c
sbin/mount_cd9660/mount_cd9660.c
sbin/mount_ext2fs/mount_ext2fs.c
sbin/mount_ffs/mount_ffs.c
sbin/mount_msdos/mount_msdos.c
sbin/mount_tmpfs/mount_tmpfs.c
sbin/newfs/newfs.c
sbin/newfs_ext2fs/newfs_ext2fs.c
sbin/savecore/savecore.c
sbin/scsi/scsi.c
sbin/ttyflags/ttyflags.c
usr.bin/biff/biff.c
usr.bin/cal/cal.c
usr.bin/cap_mkdb/cap_mkdb.c
usr.bin/chpass/chpass.c
usr.bin/col/col.c
usr.bin/colrm/colrm.c
usr.bin/comm/comm.c
usr.bin/ctags/ctags.c
usr.bin/cut/cut.c
usr.bin/du/du.c
usr.bin/expand/expand.c
usr.bin/find/main.c
usr.bin/finger/finger.c
usr.bin/gencat/gencat.c
usr.bin/getconf/getconf.c
usr.bin/hexdump/hexsyntax.c
usr.bin/id/id.c
usr.bin/join/join.c
usr.bin/lastcomm/lastcomm.c
usr.bin/logger/logger.c
usr.bin/look/look.c
usr.bin/m4/main.c
usr.bin/make/main.c
usr.bin/mesg/mesg.c
usr.bin/netstat/main.c
usr.bin/nfsstat/nfsstat.c
usr.bin/nl/nl.c
usr.bin/nm/nm.c
usr.bin/paste/paste.c
usr.bin/rdist/rdist.c
usr.bin/rdistd/rdistd.c
usr.bin/sed/main.c
usr.bin/ssh/ssh-keygen.c
usr.bin/ssh/ssh-keyscan.c
usr.bin/ssh/sshd.c
usr.bin/tail/tail.c
usr.bin/telnet/main.c
usr.bin/tput/tput.c
usr.bin/tr/tr.c
usr.bin/tset/tset.c
usr.bin/tty/tty.c
usr.bin/unvis/unvis.c
usr.bin/usbhidaction/usbhidaction.c
usr.bin/usbhidctl/usbhid.c
usr.bin/users/users.c
usr.bin/vis/vis.c
usr.bin/vmstat/vmstat.c
usr.bin/w/w.c
usr.bin/wc/wc.c
usr.bin/xargs/xargs.c
usr.bin/xinstall/xinstall.c
usr.sbin/ac/ac.c
usr.sbin/apmd/apmd.c
usr.sbin/dev_mkdb/dev_mkdb.c
usr.sbin/fdformat/fdformat.c
usr.sbin/hotplugd/hotplugd.c
usr.sbin/inetd/inetd.c
usr.sbin/iostat/iostat.c
usr.sbin/lpr/lpq/lpq.c
usr.sbin/makefs/makefs.c
usr.sbin/mtree/mtree.c
usr.sbin/netgroup_mkdb/netgroup_mkdb.c
usr.sbin/pwd_mkdb/pwd_mkdb.c
usr.sbin/rpc.lockd/lockd.c
usr.sbin/rpc.statd/statd.c
usr.sbin/sa/main.c
usr.sbin/wsconscfg/wsconscfg.c
usr.sbin/wsfontload/wsfontload.c