Skip to content

Commit 663e5b0

Browse files
committed
v0.1
1 parent 257aae6 commit 663e5b0

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ bool REPLMode = true;
99
int 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!\nUsage:\n" << argv[0] << " <filename>" << std::endl;
18+
return EXIT_FAILURE;
1619
}
1720

1821
srand((unsigned int) time(NULL));

src/repl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static const char *multilineKeywords[] = {
1111
};
1212

1313
bool startREPL() {
14-
std::cout << "PseudoEngine(v2) Experimental REPL\nEnter 'EXIT' to quit\n";
14+
std::cout << "PseudoEngine2 v0.1 REPL\nEnter 'EXIT' to quit\n";
1515

1616
Lexer lexer;
1717
Parser parser;

src/runFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)