Add -l for compatibility with wrc, and rc. Use the short option as a key for

long options that have a synonymous short option.
This commit is contained in:
Nick Clifton 2003-04-05 08:21:47 +00:00
parent 7df05f2b91
commit 3077f5d8b2
3 changed files with 27 additions and 22 deletions

View file

@ -1,3 +1,10 @@
2003-04-05 Dimitrie O. Paun <dpaun@rogers.com>
* windres.c: Add -l for compatibility with wrc, and rc.
Use the short option as a key for long options that have
a synonymous short option.
* doc/binutils.texi: Added -l to the list of options.
2003-04-03 Dimitrie O. Paun <dpaun@rogers.com> 2003-04-03 Dimitrie O. Paun <dpaun@rogers.com>
* windres.c: Add -U for compatibility with wrc, rc, and cpp. * windres.c: Add -U for compatibility with wrc, rc, and cpp.

View file

@ -2626,6 +2626,7 @@ Ignored for compatibility with rc.
Enable verbose mode. This tells you what the preprocessor is if you Enable verbose mode. This tells you what the preprocessor is if you
didn't specify one. didn't specify one.
@item -l @var{val}
@item --language @var{val} @item --language @var{val}
Specify the default language to use when reading an @code{rc} file. Specify the default language to use when reading an @code{rc} file.
@var{val} should be a hexadecimal language code. The low eight bits are @var{val} should be a hexadecimal language code. The low eight bits are
@ -2642,9 +2643,11 @@ go the console).
Use popen, not a temporary file, to read the output of the preprocessor. Use popen, not a temporary file, to read the output of the preprocessor.
This is the default behaviour. This is the default behaviour.
@item -h
@item --help @item --help
Prints a usage summary. Prints a usage summary.
@item -V
@item --version @item --version
Prints the version number for @command{windres}. Prints the version number for @command{windres}.

View file

@ -106,22 +106,19 @@ static struct include_dir *include_dirs;
/* 150 isn't special; it's just an arbitrary non-ASCII char value. */ /* 150 isn't special; it's just an arbitrary non-ASCII char value. */
#define OPTION_HELP 150 #define OPTION_INCLUDE_DIR 150
#define OPTION_INCLUDE_DIR (OPTION_HELP + 1) #define OPTION_PREPROCESSOR (OPTION_INCLUDE_DIR + 1)
#define OPTION_LANGUAGE (OPTION_INCLUDE_DIR + 1)
#define OPTION_PREPROCESSOR (OPTION_LANGUAGE + 1)
#define OPTION_USE_TEMP_FILE (OPTION_PREPROCESSOR + 1) #define OPTION_USE_TEMP_FILE (OPTION_PREPROCESSOR + 1)
#define OPTION_NO_USE_TEMP_FILE (OPTION_USE_TEMP_FILE + 1) #define OPTION_NO_USE_TEMP_FILE (OPTION_USE_TEMP_FILE + 1)
#define OPTION_VERSION (OPTION_NO_USE_TEMP_FILE + 1) #define OPTION_YYDEBUG (OPTION_NO_USE_TEMP_FILE + 1)
#define OPTION_YYDEBUG (OPTION_VERSION + 1)
static const struct option long_options[] = static const struct option long_options[] =
{ {
{"define", required_argument, 0, 'D'}, {"define", required_argument, 0, 'D'},
{"help", no_argument, 0, OPTION_HELP}, {"help", no_argument, 0, 'h'},
{"include-dir", required_argument, 0, OPTION_INCLUDE_DIR}, {"include-dir", required_argument, 0, OPTION_INCLUDE_DIR},
{"input-format", required_argument, 0, 'I'}, {"input-format", required_argument, 0, 'I'},
{"language", required_argument, 0, OPTION_LANGUAGE}, {"language", required_argument, 0, 'l'},
{"output-format", required_argument, 0, 'O'}, {"output-format", required_argument, 0, 'O'},
{"preprocessor", required_argument, 0, OPTION_PREPROCESSOR}, {"preprocessor", required_argument, 0, OPTION_PREPROCESSOR},
{"target", required_argument, 0, 'F'}, {"target", required_argument, 0, 'F'},
@ -129,7 +126,7 @@ static const struct option long_options[] =
{"use-temp-file", no_argument, 0, OPTION_USE_TEMP_FILE}, {"use-temp-file", no_argument, 0, OPTION_USE_TEMP_FILE},
{"no-use-temp-file", no_argument, 0, OPTION_NO_USE_TEMP_FILE}, {"no-use-temp-file", no_argument, 0, OPTION_NO_USE_TEMP_FILE},
{"verbose", no_argument, 0, 'v'}, {"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, OPTION_VERSION}, {"version", no_argument, 0, 'V'},
{"yydebug", no_argument, 0, OPTION_YYDEBUG}, {"yydebug", no_argument, 0, OPTION_YYDEBUG},
{0, no_argument, 0, 0} {0, no_argument, 0, 0}
}; };
@ -815,7 +812,7 @@ main (argc, argv)
language = 0x409; /* LANG_ENGLISH, SUBLANG_ENGLISH_US. */ language = 0x409; /* LANG_ENGLISH, SUBLANG_ENGLISH_US. */
use_temp_file = 0; use_temp_file = 0;
while ((c = getopt_long (argc, argv, "i:o:I:O:F:D:U:rhHvV", long_options, while ((c = getopt_long (argc, argv, "i:l:o:I:O:F:D:U:rhHvV", long_options,
(int *) 0)) != EOF) (int *) 0)) != EOF)
{ {
switch (c) switch (c)
@ -904,7 +901,7 @@ main (argc, argv)
break; break;
case OPTION_LANGUAGE: case 'l':
language = strtol (optarg, (char **) NULL, 16); language = strtol (optarg, (char **) NULL, 16);
break; break;
@ -924,12 +921,10 @@ main (argc, argv)
case 'h': case 'h':
case 'H': case 'H':
case OPTION_HELP:
usage (stdout, 0); usage (stdout, 0);
break; break;
case 'V': case 'V':
case OPTION_VERSION:
print_version ("windres"); print_version ("windres");
break; break;