Replace custom command-line options processing with argp
[emu8051.git] / src / emugtk.c
index 328fd42..656a07e 100644 (file)
 
 static int running;
 static int running_function_tag;
-static GtkWidget *mainwin;
+
+GtkWidget *mainwin;
 
 extern struct app_config_t *cfg;
+extern struct options_t options;
 
 /* Step out of running state */
 static void
@@ -429,10 +431,7 @@ emugtk_new_file(char *file)
 int
 main(int argc, char **argv)
 {
-       char *hex_file;
-
-       ParseCommandLineOptions(argc, argv);
-
+       parse_command_line_options(argc, argv);
        app_config_load();
 
        cpu8051_init();
@@ -443,10 +442,10 @@ main(int argc, char **argv)
 
        emugtk_window_init();
 
-       hex_file = get_hex_filename();
-
-       if (hex_file != NULL)
-               emugtk_new_file(hex_file);
+       if (options.filename != NULL)
+               emugtk_new_file(options.filename);
+       else
+               emugtk_Reset();
 
        gtk_main();