const char *SourceName = NULL;\r
char IfInit = FALSE;\r
char *s;\r
- int32 i;\r
+ cell_t i;\r
int Result;\r
\r
/* For Metroworks on Mac */\r
#ifdef __MWERKS__\r
argc = ccommand(&argv);\r
#endif\r
-\r
+ \r
+ pfSetQuiet( FALSE );\r
/* Parse command line. */\r
for( i=1; i<argc; i++ )\r
{\r
IfInit = TRUE;\r
DicName = NULL;\r
break;\r
+ \r
case 'q':\r
pfSetQuiet( TRUE );\r
break;\r
+ \r
case 'd':\r
if( *s != '\0' ) DicName = s;\r
- else DicName = PF_DEFAULT_DICTIONARY;\r
+ /* Allow space after -d (Thanks Aleksej Saushev) */\r
+ /* Make sure there is another argument. */\r
+ else if( (i+1) < argc )\r
+ {\r
+ DicName = argv[++i];\r
+ }\r
+ if (DicName == NULL || *DicName == '\0')\r
+ {\r
+ DicName = PF_DEFAULT_DICTIONARY;\r
+ }\r
break;\r
+ \r
default:\r
ERR(("Unrecognized option!\n"));\r
ERR(("pforth {-i} {-q} {-dfilename.dic} {sourcefilename}\n"));\r
DicName = NULL;\r
#endif\r
\r
+#ifdef PF_UNIT_TEST\r
+ if( (Result = pfUnitTest()) != 0 )\r
+ {\r
+ ERR(("pForth stopping on unit test failure.\n"));\r
+ goto on_error;\r
+ }\r
+#endif\r
+ \r
Result = pfDoForth( DicName, SourceName, IfInit);\r
\r
on_error:\r