@@ -48,6 +48,7 @@ static struct option OPTIONS[] = {
4848 {" font" , optional_argument, NULL , ' f' },
4949 {" run" , optional_argument, NULL , ' r' },
5050 {" run-live" , optional_argument, NULL , ' x' },
51+ {" run-n-wait" ,optional_argument, NULL , ' n' },
5152 {" module" , optional_argument, NULL , ' m' },
5253 {" edit" , optional_argument, NULL , ' e' },
5354 {" debug" , optional_argument, NULL , ' d' },
@@ -291,13 +292,14 @@ int main(int argc, char* argv[]) {
291292 char *fontFamily = NULL ;
292293 char *runFile = NULL ;
293294 bool debug = false ;
295+ bool runWait = true ;
294296 int fontScale;
295297 int ide_option = -1 ;
296298 SDL_Rect rect;
297299
298300 while (1 ) {
299301 int option_index = 0 ;
300- int c = getopt_long (argc, argv, " hvkc:f:r:x:m:e:d:p:" , OPTIONS, &option_index);
302+ int c = getopt_long (argc, argv, " hvkc:f:r:x:n: m:e:d:p:" , OPTIONS, &option_index);
301303 if (c == -1 ) {
302304 // no more options
303305 if (!option_index) {
@@ -341,6 +343,11 @@ int main(int argc, char* argv[]) {
341343 runFile = strdup (optarg);
342344 ide_option = IDE_NONE;
343345 break ;
346+ case ' n' :
347+ runWait = false ;
348+ runFile = strdup (optarg);
349+ ide_option = IDE_NONE;
350+ break ;
344351 case ' x' :
345352 runFile = strdup (optarg);
346353 g_debugPort = 0 ;
@@ -404,7 +411,7 @@ int main(int argc, char* argv[]) {
404411 loadIcon (window);
405412 Runtime *runtime = new Runtime (window);
406413 runtime->construct (font.c_str (), fontBold.c_str ());
407- fontScale = runtime->runShell (runFile, fontScale, debug ? g_debugPort : 0 );
414+ fontScale = runtime->runShell (runFile, runWait, fontScale, debug ? g_debugPort : 0 );
408415 rect = runtime->getWindowRect ();
409416 delete runtime;
410417 } else {
0 commit comments