diff --git a/Mac/Include/pythonresources.h b/Mac/Include/pythonresources.h index 49e909f5878..4a69d5d9e0e 100644 --- a/Mac/Include/pythonresources.h +++ b/Mac/Include/pythonresources.h @@ -43,6 +43,7 @@ #define OPT_DEBUGGING 7 #define OPT_KEEPNORMAL 8 #define OPT_KEEPERROR 9 +#define OPT_CMDLINE 10 /* Dialog for 'No preferences directory' */ #define NOPREFDIR_ID 133 diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c index 966c2798240..bcfed1ad07d 100644 --- a/Mac/Python/macmain.c +++ b/Mac/Python/macmain.c @@ -208,7 +208,7 @@ PyMac_InitApplication() void PyMac_InteractiveOptions(int *inspect, int *verbose, int *suppress_print, int *unbuffered, int *debugging, int *keep_normal, - int *keep_error) + int *keep_error, int *argcp, char ***argvp) { KeyMap rmap; unsigned char *map; @@ -216,6 +216,8 @@ PyMac_InteractiveOptions(int *inspect, int *verbose, int *suppress_print, ControlHandle handle; DialogPtr dialog; Rect rect; + int old_argc = *argcp; + int i; /* Default-defaults: */ *keep_error = 1; @@ -233,6 +235,8 @@ PyMac_InteractiveOptions(int *inspect, int *verbose, int *suppress_print, printf("Option dialog not found - cannot set options\n"); return; } + SetDialogDefaultItem(dialog, OPT_OK); + SetDialogCancelItem(dialog, OPT_CANCEL); /* Set default values */ #define SET_OPT_ITEM(num, var) \ @@ -258,6 +262,24 @@ PyMac_InteractiveOptions(int *inspect, int *verbose, int *suppress_print, DisposDialog(dialog); exit(0); } + if ( item == OPT_CMDLINE ) { + int new_argc, newer_argc; + char **new_argv, **newer_argv; + + new_argc = ccommand(&new_argv); + newer_argc = (new_argc-1) + old_argc; + newer_argv = malloc((newer_argc+1)*sizeof(char *)); + if( !newer_argv ) + Py_FatalError("Cannot malloc argv\n"); + for(i=0; i