File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,13 @@ bool REPLMode = true;
99int main (int argc, char **argv) {
1010 auto fn = startREPL;
1111
12- if (argc > 1 ) {
12+ if (argc == 2 ) {
1313 psfilename = argv[1 ];
1414 REPLMode = false ;
1515 fn = runFile;
16+ } else if (argc > 2 ) {
17+ std::cerr << " Too many arguements!\n Usage:\n " << argv[0 ] << " <filename>" << std::endl;
18+ return EXIT_FAILURE;
1619 }
1720
1821 srand ((unsigned int ) time (NULL ));
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ static const char *multilineKeywords[] = {
1111};
1212
1313bool startREPL () {
14- std::cout << " PseudoEngine(v2) Experimental REPL\n Enter 'EXIT' to quit\n " ;
14+ std::cout << " PseudoEngine2 v0.1 REPL\n Enter 'EXIT' to quit\n " ;
1515
1616 Lexer lexer;
1717 Parser parser;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ bool runFile() {
77 std::ifstream file (psfilename);
88
99 if (!file.is_open ()) {
10- std::cerr << " File not found!" << std::endl;
10+ std::cerr << " Error: File ' " << psfilename << " ' not found!" << std::endl;
1111 return false ;
1212 }
1313
You can’t perform that action at this time.
0 commit comments