allow -b option

whole parsing of command line will be rewriten
This commit is contained in:
VaclavT 2021-04-14 07:50:36 +02:00
parent 2cef7a4a2b
commit e0574837b6
1 changed files with 1 additions and 1 deletions

2
ml.cpp
View File

@ -1954,7 +1954,7 @@ int main(int argc, char *argv[]) {
for (size_t i = 0; i < files.size(); i++) for (size_t i = 0; i < files.size(); i++)
run(read_file_contents(files[i]), env); run(read_file_contents(files[i]), env);
// just one parameter - filename // just one parameter - filename
} else if (argc == 2) { } else if (argc == 2 && !cmdOptionExists(argv, argv + argc, "-b")) {
std::string file_content = read_file_contents(argv[1]); std::string file_content = read_file_contents(argv[1]);
if (file_content.find("#!") == 0) // shebang ? if (file_content.find("#!") == 0) // shebang ?
file_content.erase(0, file_content.find("\n") + 1); // TODO mac osx newline?? file_content.erase(0, file_content.find("\n") + 1); // TODO mac osx newline??