diff toys/other/dos2unix.c @ 1634:5fac2769a159 draft

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.
author Rob Landley <rob@landley.net>
date Wed, 31 Dec 2014 21:30:59 -0600
parents 6cc69be43c42
children 3d1b78e5e066
line wrap: on
line diff
--- a/toys/other/dos2unix.c	Wed Dec 31 21:23:37 2014 -0600
+++ b/toys/other/dos2unix.c	Wed Dec 31 21:30:59 2014 -0600
@@ -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"