#include <iostream>
#include <fstream>
#include <string>
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
dummy-compiler only tests its interface rather than its functionality.
./dummy-compiler –target ${TARGET_NAME} –verbose ${INPUT_NAME} ${OUTPUT_NAME}
Definition at line 27 of file dummy-compiler.cpp.
28{
29 if (argc != 2 and argc != 6)
30 return EXIT_FAILURE;
31 if (argc == 2)
32 {
33 std::string help_o{"-h"};
34 std::string argv_1{
argv[1]};
35 if (help_o != argv_1)
36 return EXIT_FAILURE;
37
38 std::cout << "HELP MESSAGE!!" << std::endl;
39 return EXIT_SUCCESS;
40 }
41 std::string target_name{
argv[2]};
42 std::string output_name{
argv[5]};
43
44 std::ofstream
outfile(output_name);
45
46 outfile <<
"dummy-compiler with " << target_name <<
" target" << std::endl;
47
48 return EXIT_SUCCESS;
49}