Skip to content

Commit 43fb43a

Browse files
authored
Make LCompilers CLI check if source file exists (#1531)
1 parent d66b71f commit 43fb43a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/bin/lpython.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,6 +1559,9 @@ int main(int argc, char *argv[])
15591559
// TODO: for now we ignore the other filenames, only handle
15601560
// the first:
15611561
std::string arg_file = arg_files[0];
1562+
if (CLI::NonexistentPath(arg_file).empty()){
1563+
throw LCompilers::LCompilersException("No such file or directory: " + arg_file);
1564+
}
15621565

15631566
std::string outfile;
15641567
std::string basename;

0 commit comments

Comments
 (0)