[svn:parrot] r43933 - trunk/src

bacek at svn.parrot.org bacek at svn.parrot.org
Sat Feb 13 09:16:13 UTC 2010


Author: bacek
Date: Sat Feb 13 09:16:13 2010
New Revision: 43933
URL: https://trac.parrot.org/parrot/changeset/43933

Log:
Replace Parrot_ex_throw with fprintf(stderr) in CLI parsing. Part of TT#1436.

Modified:
   trunk/src/main.c

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	Sat Feb 13 09:16:00 2010	(r43932)
+++ trunk/src/main.c	Sat Feb 13 09:16:13 2010	(r43933)
@@ -398,9 +398,10 @@
             else if (STREQ(opt.opt_arg, "gcdebug"))
                 *core = PARROT_GC_DEBUG_CORE;
             else
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
+                fprintf(stderr,
                         "main: Unrecognized runcore '%s' specified."
                         "\n\nhelp: parrot -h\n", opt.opt_arg);
+                exit(EXIT_FAILURE);
             break;
           case 'g':
             if (STREQ(opt.opt_arg, "ms"))
@@ -408,9 +409,10 @@
             else if (STREQ(opt.opt_arg, "inf"))
                 interp->gc_sys->sys_type = INF;
             else
-                Parrot_ex_throw_from_c_args(interp, NULL, 1,
+                fprintf(stderr,
                         "main: Unrecognized GC '%s' specified."
                         "\n\nhelp: parrot -h\n", opt.opt_arg);
+                exit(EXIT_FAILURE);
             break;
           case 't':
             if (opt.opt_arg && is_all_hex_digits(opt.opt_arg))
@@ -438,6 +440,7 @@
             exit(EXIT_FAILURE);
             break;
           case OPT_RUNTIME_PREFIX:
+            /* FIXME It will die. STRING subsystem isn't initialized yet */
             Parrot_io_printf(interp, "%Ss\n",
                     Parrot_get_runtime_path(interp));
             exit(EXIT_SUCCESS);
@@ -475,9 +478,10 @@
                 break;
 
             /* PIRC flags handling goes here */
-            Parrot_ex_throw_from_c_args(interp, NULL, 1,
+            fprintf(stderr,
                     "main: Invalid flag '%s' used.\n\nhelp: parrot -h\n",
                     (*argv)[0]);
+            exit(EXIT_FAILURE);
         }
     }
 


More information about the parrot-commits mailing list