diff options
author | Rob Landley <rob@landley.net> | 2014-12-31 21:30:59 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-12-31 21:30:59 -0600 |
commit | f3e56f4e4ff773de95fa2c9daf979734d826fc33 (patch) | |
tree | 8a8e75b3530b504569ebe4fae09020073534c6db /toys/other | |
parent | 5834ddd6df659d9c9dc7333284fc86762dea061a (diff) | |
download | toybox-f3e56f4e4ff773de95fa2c9daf979734d826fc33.tar.gz |
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.
Diffstat (limited to 'toys/other')
-rw-r--r-- | toys/other/dos2unix.c | 2 | ||||
-rw-r--r-- | toys/other/nbd_client.c | 2 | ||||
-rw-r--r-- | toys/other/netcat.c | 2 | ||||
-rw-r--r-- | toys/other/reboot.c | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/toys/other/dos2unix.c b/toys/other/dos2unix.c index 3e1feb0e..690c5a8e 100644 --- a/toys/other/dos2unix.c +++ b/toys/other/dos2unix.c @@ -3,7 +3,7 @@ * Copyright 2012 Rob Landley <rob@landley.net> USE_DOS2UNIX(NEWTOY(dos2unix, NULL, TOYFLAG_BIN)) -USE_DOS2UNIX(OLDTOY(unix2dos, dos2unix, NULL, TOYFLAG_BIN)) +USE_DOS2UNIX(OLDTOY(unix2dos, dos2unix, TOYFLAG_BIN)) config DOS2UNIX bool "dos2unix/unix2dos" diff --git a/toys/other/nbd_client.c b/toys/other/nbd_client.c index 969ad4ae..c16585a2 100644 --- a/toys/other/nbd_client.c +++ b/toys/other/nbd_client.c @@ -8,7 +8,7 @@ // things like prototype "nbd-client_main" which isn't a valid symbol. So // we hide the underscore name and OLDTOY the name we want. USE_NBD_CLIENT(NEWTOY(nbd_client, "<3>3ns", 0)) -USE_NBD_CLIENT(OLDTOY(nbd-client, nbd_client, OPTSTR_nbd_client, TOYFLAG_USR|TOYFLAG_BIN)) +USE_NBD_CLIENT(OLDTOY(nbd-client, nbd_client, TOYFLAG_USR|TOYFLAG_BIN)) config NBD_CLIENT bool "nbd-client" diff --git a/toys/other/netcat.c b/toys/other/netcat.c index 2c1ec7b2..58f08251 100644 --- a/toys/other/netcat.c +++ b/toys/other/netcat.c @@ -4,7 +4,7 @@ * * TODO: udp, ipv6, genericize for telnet/microcom/tail-f -USE_NETCAT(OLDTOY(nc, netcat, USE_NETCAT_LISTEN("tl^L^")"w#p#s:q#f:", TOYFLAG_BIN)) +USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_BIN)) USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("tl^L^")"w#p#s:q#f:", TOYFLAG_BIN)) config NETCAT diff --git a/toys/other/reboot.c b/toys/other/reboot.c index 5cbc4f87..8baa4d8a 100644 --- a/toys/other/reboot.c +++ b/toys/other/reboot.c @@ -3,8 +3,8 @@ * Copyright 2013 Elie De Brauwer <eliedebrauwer@gmail.com> USE_REBOOT(NEWTOY(reboot, "n", TOYFLAG_BIN|TOYFLAG_NEEDROOT)) -USE_REBOOT(OLDTOY(halt, reboot, "n", TOYFLAG_BIN|TOYFLAG_NEEDROOT)) -USE_REBOOT(OLDTOY(poweroff, reboot, "n", TOYFLAG_BIN|TOYFLAG_NEEDROOT)) +USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_BIN|TOYFLAG_NEEDROOT)) +USE_REBOOT(OLDTOY(poweroff, reboot, TOYFLAG_BIN|TOYFLAG_NEEDROOT)) config REBOOT bool "reboot" |