allow -b option
whole parsing of command line will be rewriten
This commit is contained in:
parent
2cef7a4a2b
commit
e0574837b6
2
ml.cpp
2
ml.cpp
|
|
@ -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??
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue