Redo option parsing infrastructure so #define FORCE_FLAGS can unzero flag macros...
authorRob Landley <rob@landley.net>
Thu, 1 Jan 2015 03:30:59 +0000 (21:30 -0600)
committerRob Landley <rob@landley.net>
Thu, 1 Jan 2015 03:30:59 +0000 (21:30 -0600)
commitf3e56f4e4ff773de95fa2c9daf979734d826fc33
tree8a8e75b3530b504569ebe4fae09020073534c6db
parent5834ddd6df659d9c9dc7333284fc86762dea061a
Redo option parsing infrastructure so #define FORCE_FLAGS can unzero flag macros for a disabled command (needed when multiple commands share infrastructure with a common set of flags).

This means the flag space is no longer packed, but leaves gaps where the zeroes
go. (Actual flag bit positions are the same for all configs.) Since the
option parsing needs to know where the holes are, the OPTSTR values are
now generated as part of flags.h with ascii 1 values for the disabled values.
(So generated/oldflags.h went away.)

This also means that the option string argument for OLDTOY() went away, it now
uses the same arguments as the NEWTOY() it references.
23 files changed:
lib/help.c
main.c
scripts/make.sh
scripts/mkflags.c
toys.h
toys/other/dos2unix.c
toys/other/nbd_client.c
toys/other/netcat.c
toys/other/reboot.c
toys/pending/ftpget.c
toys/pending/groupadd.c
toys/pending/groupdel.c
toys/pending/ip.c
toys/pending/pgrep.c
toys/pending/sh.c
toys/pending/tcpsvd.c
toys/pending/traceroute.c
toys/pending/useradd.c
toys/pending/userdel.c
toys/posix/chgrp.c
toys/posix/grep.c
toys/posix/id.c
toys/posix/true.c