diff options
Diffstat (limited to 'mixutils/mixvm.c')
-rw-r--r-- | mixutils/mixvm.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/mixutils/mixvm.c b/mixutils/mixvm.c index edf7ac5..4c28557 100644 --- a/mixutils/mixvm.c +++ b/mixutils/mixvm.c @@ -30,7 +30,7 @@ #include <getopt.h> extern void -mix_vmloop (const gchar *code_file); +mix_vmloop (const gchar *code_file, gboolean use_emacs); static void mix_vmrun (const gchar *code_file, gboolean dump); @@ -40,10 +40,11 @@ enum { HELP_OPT = 'h', USAGE_OPT = 'u', RUN_OPT = 'r', - DUMP_OPT = 'd' + DUMP_OPT = 'd', + EMACS_OPT = 'e', /* used by mixvm-gud only */ }; -static const char *options_ = "vhurd"; +static const char *options_ = "vhurd"; /* no short opt for --emacs */ static struct option long_options_[] = { @@ -52,13 +53,14 @@ static struct option long_options_[] = {"usage", no_argument, 0, USAGE_OPT}, {"run", required_argument, 0, RUN_OPT}, {"dump", no_argument, 0, DUMP_OPT}, + /* pek: yo! */ + {"emacs", no_argument, 0, EMACS_OPT}, {0, 0, 0, 0} }; static const gchar *USAGE_ = N_("Usage: %s [-vhurd] [--version] [--help] [--usage] [--run] [--dump] [MIX_FILE]\n"); - int main (int argc, char **argv) { @@ -67,6 +69,7 @@ main (int argc, char **argv) const char *in = NULL; gboolean run = FALSE; gboolean dump = FALSE; + gboolean emacs = FALSE; setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); @@ -101,6 +104,9 @@ main (int argc, char **argv) /* getopt already handles the output of a warning message */ fprintf (stderr, _("(Try: %s -h)\n"), prog_name); return EXIT_FAILURE; + case EMACS_OPT: + emacs = TRUE; + break; default: g_assert_not_reached (); } @@ -117,7 +123,7 @@ main (int argc, char **argv) mix_init_lib (); if (run) mix_vmrun(in, dump); - else mix_vmloop (in); + else mix_vmloop (in, emacs); mix_release_lib (); |