-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (40 loc) · 1.36 KB
/
Copy pathmain.cpp
File metadata and controls
48 lines (40 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* @license
* (C) PROTEI protei.ru
*/
#include <iostream>
#include <unistd.h>
#include <getopt.h>
#include "src/StatesController.hpp"
const struct option long_options[] = {
{"input", required_argument, nullptr, 'i'},
{"output", required_argument, nullptr, 'o'},
{"help", no_argument, nullptr, 'h'},
{nullptr, 0, nullptr, 0}
};
int main(int argc, char* argv[]) {
std::string input_filename, output_filename = "a.csv";
int opt, opt_index = 0;
if (argc == 1) {
std::cout << "-i --input: input filename\n-o --output: output filename\n";
} else {
while((opt = getopt_long(argc, argv, "i:o:h", long_options, &opt_index)) != -1){
switch(opt){
case 'i':
input_filename = optarg;
break;
case 'o':
output_filename = optarg;
break;
case 'h':
std::cout << "-i --input: input filename\n-o --output: output filename\n";
break;
}
}
}
std::cout << "input name: " << input_filename << std::endl << "output name: " << output_filename << std::endl;
InputParser inputParser(input_filename);
StatesController states(inputParser, output_filename);
states.findStatesInvalidation();
return 0;
}