-g and -x take optional arguments, just like their long options.
* build-aux/cross-options.pl: Use /x to make the regexp easier to
understand.
Fix the handling of $opt which resulted in all the argument to be
considered as optional.
+2008-02-28 Akim Demaille <akim@epita.fr>
+
+ * src/getargs.c (short_options): Split and sort for readability.
+ -g and -x take optional arguments, just like their long options.
+ * build-aux/cross-options.pl: Use /x to make the regexp easier to
+ understand.
+ Fix the handling of $opt which resulted in all the argument to be
+ considered as optional.
+
2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
* NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
* NEWS (2.3a+): Don't say %language is experimental. Mention Java and
- if (/^\s*(?:(-\w), )?(--[-\w]+)(\[?)(=[-\w]+)?\]?/)
+ if (/^\s* # Initial spaces.
+ (?:(-\w),\s+)? # $1: Possible short option.
+ (--[-\w]+) # $2: Long option.
+ (\[?) # $3: '[' iff the argument is optional.
+ (?:=([-\w]+))? # $4: Possible argument name.
+ /x)
{
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
$short = defined $short ? '@option{' . $short . '}' : '';
{
my ($short, $long, $opt, $arg) = ($1, $2, $3, $4);
$short = defined $short ? '@option{' . $short . '}' : '';
$arg =~ s/^=//;
$arg = '@var{' . lc ($arg) . '}';
$arg = '[' . $arg . ']'
$arg =~ s/^=//;
$arg = '@var{' . lc ($arg) . '}';
$arg = '[' . $arg . ']'
$option{"$long=$arg"} = $short ? "$short $arg" : '';
}
else
$option{"$long=$arg"} = $short ? "$short $arg" : '';
}
else
| Process the options. |
`----------------------*/
| Process the options. |
`----------------------*/
-/* Shorts options. */
-static char const short_options[] = "yvegxdhr:L:ltknVo:b:p:S:T::W";
+/* Shorts options.
+ Should be computed from long_options. */
+static char const short_options[] =
+ "L:"
+ "S:"
+ "T::"
+ "V"
+ "W"
+ "b:"
+ "d"
+ "e"
+ "g::"
+ "h"
+ "k"
+ "l"
+ "n"
+ "o:"
+ "p:"
+ "r:"
+ "t"
+ "v"
+ "x::"
+ "y"
+ ;
/* Values for long options that do not have single-letter equivalents. */
enum
/* Values for long options that do not have single-letter equivalents. */
enum