-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (27 loc) · 742 Bytes
/
main.cpp
File metadata and controls
33 lines (27 loc) · 742 Bytes
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
#include <iostream>
#include <string>
#include "include/fileRead.h"
int main(int argc, char *argv[])
{
std::string code;
if ((argc - 1) >= 1 && (argc - 1) < 2) // when exactly one argument is given
{
readFromFile(argv[1]);
}
else if ((argc - 1) == 0) // When no arguments are given
{
std::cout << introText << "\n"
<< dashes << std::endl;
while (code != exitCommand)
{
std::cout << lineDis;
std::getline(std::cin, code);
mainHeart(code);
}
}
else // When more than 1 arguments are given
{
std::cout << "Too many arguments" << std::endl;
std::exit(0);
}
}