]> granicus.if.org Git - yasm/commitdiff
* yasm.c (options): Allow -i as a synonym for -I.
authorPeter Johnson <peter@tortall.net>
Mon, 24 Jan 2005 06:44:25 +0000 (06:44 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 24 Jan 2005 06:44:25 +0000 (06:44 -0000)
* yasm-options.c (parse_cmdline): Make unrecognized options warnings instead
of errors.

These two changes make yasm more closely match the nasm command line.  The
long-term fix for this will be making a nasm-like frontend.

Requested by: Brian Gladman <brg@gladman.plus.com>

svn path=/trunk/yasm/; revision=1197

frontends/yasm/yasm-options.c
frontends/yasm/yasm.c

index 98b9750312c577b75e07d6ab49205da095c37096..a314bafd1f7db6391913578f152793c87332c42c 100644 (file)
@@ -45,7 +45,7 @@ int
 parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts,
              void (*print_error) (const char *fmt, ...))
 {
-    int errors = 0;
+    int errors = 0, warnings = 0;
     size_t i;
     int got_it;
 
@@ -86,8 +86,9 @@ parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts,
                    }
                }
                if (!got_it) {
-                   print_error(_("unrecognized option `%s'"), argv[0]);
-                   errors++;
+                   print_error(_("warning: unrecognized option `%s'"),
+                               argv[0]);
+                   warnings++;
                }
            } else {            /* sopt */
 
@@ -119,8 +120,9 @@ parse_cmdline(int argc, char **argv, opt_option *options, size_t nopts,
                    }
                }
                if (!got_it) {
-                   print_error(_("unrecognized option `%s'"), argv[0]);
-                   errors++;
+                   print_error(_("warning: unrecognized option `%s'"),
+                               argv[0]);
+                   warnings++;
                }
            }
        } else {    /* not an option, then it should be a file or something */
index c98a7fd9aa8909f03df29477ba5d902ac2f46854..a5129b774fee0ffefb51c9122f615f9f37917d7a 100644 (file)
@@ -144,6 +144,8 @@ static opt_option options[] =
       N_("enables/disables warning"), NULL },
     { 'e', "preproc-only", 0, preproc_only_handler, 0,
       N_("preprocess only (writes output to stdout by default)"), NULL },
+    { 'i', NULL, 1, opt_preproc_option, 0,
+      N_("add include path"), N_("path") },
     { 'I', NULL, 1, opt_preproc_option, 0,
       N_("add include path"), N_("path") },
     { 'P', NULL, 1, opt_preproc_option, 1,