aboutsummaryrefslogtreecommitdiff
path: root/vendor/cmilan/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/cmilan/src/main.cpp')
-rw-r--r--vendor/cmilan/src/main.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/cmilan/src/main.cpp b/vendor/cmilan/src/main.cpp
new file mode 100644
index 0000000..9de9803
--- /dev/null
+++ b/vendor/cmilan/src/main.cpp
@@ -0,0 +1,32 @@
1#include "parser.h"
2#include <iostream>
3#include <cstdlib>
4
5using namespace std;
6
7void printHelp()
8{
9 cout << "Usage: cmilan input_file" << endl;
10}
11
12int main(int argc, char** argv)
13{
14 if(argc < 2) {
15 printHelp();
16 return EXIT_FAILURE;
17 }
18
19 ifstream input;
20 input.open(argv[1]);
21
22 if(input) {
23 Parser p(argv[1], input);
24 p.parse();
25 return EXIT_SUCCESS;
26 }
27 else {
28 cerr << "File '" << argv[1] << "' not found" << endl;
29 return EXIT_FAILURE;
30 }
31}
32