changeset 1225:06206518a74c

There are cases when the long options are of the format abc-def. In current implementation FLAG_xxx macros are generated for long options too. with __-__ sign in the macro, it will generate errors. I am of the opinion that __-__ be converted to '_' for generating the FLAG_xxx macros and be used in the command. This will enable the user to 'abc-def', but be handled like 'abc_def' in code.
author Ashwini Sharma <ak.ashwini1981@gmail.com>
date Wed, 19 Mar 2014 13:57:06 -0500
parents 3aba6950b886
children e1b09affb6db
files scripts/mkflags.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/mkflags.c	Sun Mar 16 16:27:38 2014 -0500
+++ b/scripts/mkflags.c	Wed Mar 19 13:57:06 2014 -0500
@@ -44,7 +44,7 @@
         blank->lopt = new;
         list = blank;
       }
-      while (*++string != ')');  // An empty longopt () would break this.
+      while (*++string != ')') if (*string == '-') *string = '_';  // An empty longopt () would break this.
       *(string++) = 0;
       continue;
     }