aboutsummaryrefslogtreecommitdiff
path: root/binutils/windres.c
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/windres.c')
-rw-r--r--binutils/windres.c58
1 files changed, 30 insertions, 28 deletions
diff --git a/binutils/windres.c b/binutils/windres.c
index f802706..0b56bc2 100644
--- a/binutils/windres.c
+++ b/binutils/windres.c
@@ -1,5 +1,5 @@
/* windres.c -- a program to manipulate Windows resources
- Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of GNU Binutils.
@@ -638,13 +638,11 @@ format_from_filename (filename, input)
/* If we don't recognize the name of an output file, assume it's a
COFF file. */
-
if (! input)
return RES_FORMAT_COFF;
/* Read the first few bytes of the file to see if we can guess what
it is. */
-
e = fopen (filename, FOPEN_RB);
if (e == NULL)
fatal ("%s: %s", filename, strerror (errno));
@@ -701,45 +699,46 @@ usage (stream, status)
FILE *stream;
int status;
{
- fprintf (stream, _("Usage: %s [options] [input-file] [output-file]\n"),
+ fprintf (stream, _("Usage: %s [option(s)] [input-file] [output-file]\n"),
program_name);
- fprintf (stream, _("\
-Options:\n\
- -i FILE, --input FILE Name input file\n\
- -o FILE, --output FILE Name output file\n\
- -I FORMAT, --input-format FORMAT\n\
- Specify input format\n\
- -O FORMAT, --output-format FORMAT\n\
- Specify output format\n\
- -F TARGET, --target TARGET Specify COFF target\n\
- --preprocessor PROGRAM Program to use to preprocess rc file\n\
- --include-dir DIR Include directory when preprocessing rc file\n\
- -DSYM[=VAL], --define SYM[=VAL]\n\
- Define SYM when preprocessing rc file\n\
- -v Verbose - tells you what it's doing\n\
- --language VAL Set language when reading rc file\n\
- --use-temp-file Use a temporary file instead of popen to read\n\
- the preprocessor output\n\
- --no-use-temp-file Use popen (default)\n"));
+ fprintf (stream, _(" The options are:\n\
+ -i --input=<file> Name input file\n\
+ -o --output=<file> Name output file\n\
+ -I --input-format=<format> Specify input format\n\
+ -O --output-format=<format> Specify output format\n\
+ -F --target=<target> Specify COFF target\n\
+ --preprocessor=<program> Program to use to preprocess rc file\n\
+ --include-dir=<dir> Include directory when preprocessing rc file\n\
+ -D --define <sym>[=<val>] Define SYM when preprocessing rc file\n\
+ -v --verbose Verbose - tells you what it's doing\n\
+ --language=<val> Set language when reading rc file\n\
+ --use-temp-file Use a temporary file instead of popen to read\n\
+ the preprocessor output\n\
+ --no-use-temp-file Use popen (default)\n"));
#ifdef YYDEBUG
fprintf (stream, _("\
- --yydebug Turn on parser debugging\n"));
+ --yydebug Turn on parser debugging\n"));
#endif
fprintf (stream, _("\
- --help Print this help message\n\
- --version Print version information\n"));
+ -h --help Print this help message\n\
+ -V --version Print version information\n"));
fprintf (stream, _("\
FORMAT is one of rc, res, or coff, and is deduced from the file name\n\
extension if not specified. A single file name is an input file.\n\
No input-file is stdin, default rc. No output-file is stdout, default rc.\n"));
+
list_supported_targets (program_name, stream);
+
if (status == 0)
fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO);
+
exit (status);
}
-/* Quote characters that will confuse the shell when we run the preprocessor */
-static const char *quot (string)
+/* Quote characters that will confuse the shell when we run the preprocessor. */
+
+static const char *
+quot (string)
const char *string;
{
static char *buf = 0;
@@ -813,7 +812,7 @@ main (argc, argv)
language = -1;
use_temp_file = 0;
- while ((c = getopt_long (argc, argv, "i:o:I:O:F:D:v", long_options,
+ while ((c = getopt_long (argc, argv, "i:o:I:O:F:D:hHvV", long_options,
(int *) 0)) != EOF)
{
switch (c)
@@ -916,10 +915,13 @@ main (argc, argv)
break;
#endif
+ case 'h':
+ case 'H':
case OPTION_HELP:
usage (stdout, 0);
break;
+ case 'V':
case OPTION_VERSION:
print_version ("windres");
break;