aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-04-23 09:00:22 +0000
committerNick Clifton <nickc@redhat.com>2003-04-23 09:00:22 +0000
commit32df89660fbc80c6a7278e0f10a92ec92352800c (patch)
treee6c82129f811b535fc971e42f6f691bee1249ee9
parent8c29f035d9fe007e6586a18e05b695a3de8e9aab (diff)
downloadgdb-32df89660fbc80c6a7278e0f10a92ec92352800c.zip
gdb-32df89660fbc80c6a7278e0f10a92ec92352800c.tar.gz
gdb-32df89660fbc80c6a7278e0f10a92ec92352800c.tar.bz2
Accept -fo as an alias for -o
-rw-r--r--binutils/ChangeLog10
-rw-r--r--binutils/doc/binutils.texi3
-rw-r--r--binutils/windres.c76
3 files changed, 59 insertions, 30 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 6bc473b..ec73a37 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,13 @@
+2003-04-23 Dimitrie O. Paun <dpaun@rogers.com>
+ Nick Clifton <nickc@redhat.com>
+
+ * windres.c (long_options): Move close to main, where it is used.
+ Add 'input' and 'output' long options.
+ (main): Accept "-fo" as an alias for "-o". This is for rc
+ comptibility.
+ * doc/binutils.texi: Mention that -fo is accepted as an alias for
+ -o, but discourage its use.
+
2003-04-22 Dimitrie O. Paun <dpaun@rogers.com>
* windres.c (format_from_name): Make the exit on error
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index 3de034a..b673169 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -2567,7 +2567,8 @@ The name of the input file. If this option is not used, then
@command{windres} will use the first non-option argument as the input file
name. If there are no non-option arguments, then @command{windres} will
read from standard input. @command{windres} can not read a COFF file from
-standard input.
+standard input. Note, for compatability with @command{rc} the option
+@option{-fo} is also accepted, but its use is not recommended.
@item -o @var{filename}
@itemx --output @var{filename}
diff --git a/binutils/windres.c b/binutils/windres.c
index fbaaf1b..d874fc0 100644
--- a/binutils/windres.c
+++ b/binutils/windres.c
@@ -102,34 +102,6 @@ struct include_dir
static struct include_dir *include_dirs;
-/* Long options. */
-
-/* 150 isn't special; it's just an arbitrary non-ASCII char value. */
-
-#define OPTION_PREPROCESSOR 150
-#define OPTION_USE_TEMP_FILE (OPTION_PREPROCESSOR + 1)
-#define OPTION_NO_USE_TEMP_FILE (OPTION_USE_TEMP_FILE + 1)
-#define OPTION_YYDEBUG (OPTION_NO_USE_TEMP_FILE + 1)
-
-static const struct option long_options[] =
-{
- {"define", required_argument, 0, 'D'},
- {"help", no_argument, 0, 'h'},
- {"include-dir", required_argument, 0, 'I'},
- {"input-format", required_argument, 0, 'J'},
- {"language", required_argument, 0, 'l'},
- {"output-format", required_argument, 0, 'O'},
- {"preprocessor", required_argument, 0, OPTION_PREPROCESSOR},
- {"target", required_argument, 0, 'F'},
- {"undefine", required_argument, 0, 'U'},
- {"use-temp-file", no_argument, 0, OPTION_USE_TEMP_FILE},
- {"no-use-temp-file", no_argument, 0, OPTION_NO_USE_TEMP_FILE},
- {"verbose", no_argument, 0, 'v'},
- {"version", no_argument, 0, 'V'},
- {"yydebug", no_argument, 0, OPTION_YYDEBUG},
- {0, no_argument, 0, 0}
-};
-
/* Static functions. */
static void res_init PARAMS ((void));
@@ -762,6 +734,36 @@ quot (string)
return buf;
}
+/* Long options. */
+
+/* 150 isn't special; it's just an arbitrary non-ASCII char value. */
+
+#define OPTION_PREPROCESSOR 150
+#define OPTION_USE_TEMP_FILE (OPTION_PREPROCESSOR + 1)
+#define OPTION_NO_USE_TEMP_FILE (OPTION_USE_TEMP_FILE + 1)
+#define OPTION_YYDEBUG (OPTION_NO_USE_TEMP_FILE + 1)
+
+static const struct option long_options[] =
+{
+ {"input", required_argument, 0, 'i'},
+ {"output", required_argument, 0, 'o'},
+ {"input-format", required_argument, 0, 'J'},
+ {"output-format", required_argument, 0, 'O'},
+ {"target", required_argument, 0, 'F'},
+ {"preprocessor", required_argument, 0, OPTION_PREPROCESSOR},
+ {"include-dir", required_argument, 0, 'I'},
+ {"define", required_argument, 0, 'D'},
+ {"undefine", required_argument, 0, 'U'},
+ {"verbose", no_argument, 0, 'v'},
+ {"language", required_argument, 0, 'l'},
+ {"use-temp-file", no_argument, 0, OPTION_USE_TEMP_FILE},
+ {"no-use-temp-file", no_argument, 0, OPTION_NO_USE_TEMP_FILE},
+ {"yydebug", no_argument, 0, OPTION_YYDEBUG},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, no_argument, 0, 0}
+};
+
/* This keeps gcc happy when using -Wmissing-prototypes -Wstrict-prototypes. */
int main PARAMS ((int, char **));
@@ -813,7 +815,7 @@ main (argc, argv)
language = 0x409; /* LANG_ENGLISH, SUBLANG_ENGLISH_US. */
use_temp_file = 0;
- while ((c = getopt_long (argc, argv, "i:l:o:I:J:O:F:D:U:rhHvV", long_options,
+ while ((c = getopt_long (argc, argv, "f:i:l:o:I:J:O:F:D:U:rhHvV", long_options,
(int *) 0)) != EOF)
{
switch (c)
@@ -822,6 +824,22 @@ main (argc, argv)
input_filename = optarg;
break;
+ case 'f':
+ /* For compatability with rc we accept "-fo <name>" as being the
+ equivalent of "-o <name>". We do not advertise this fact
+ though, as we do not want users to use non-GNU like command
+ line switches. */
+ if (*optarg != 'o')
+ fatal (_("invalid option -f\n"));
+ optarg++;
+ if (* optarg == 0)
+ {
+ if (optind == argc)
+ fatal (_("No filename following the -fo option.\n"));
+ optarg = argv [optind++];
+ }
+ /* Fall through. */
+
case 'o':
output_filename = optarg;
break;