Command line arguments

This commit is contained in:
2025-08-25 19:13:00 +10:00
parent 1c5ca8d201
commit c952be1fe6
2 changed files with 22 additions and 0 deletions

View File

@@ -2194,6 +2194,16 @@ int main(int argc, char** argv) {
cout << "Usage: " << argv[0] << " (file)" << endl;
exit(0);
}
// Get args
List argsList;
for (int i = 2; i < argc; i++) {
Literal lit;
lit.val = argv[i];
argsList.val.push_back(lit);
}
lists["args"] = argsList;
ifstream file(argv[1]);
string lns;
string in;