-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (38 loc) · 1.48 KB
/
main.cpp
File metadata and controls
40 lines (38 loc) · 1.48 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aybiouss <aybiouss@student.1337.ma> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/04 12:25:06 by aybiouss #+# #+# */
/* Updated: 2023/10/23 18:16:27 by aybiouss ### ########.fr */
/* */
/* ************************************************************************** */
#include "Includes/Servers.hpp"
int main(int argc, char *argv[])
{
if (argc == 1 || argc == 2) {
try
{
Servers configFile;
std::string config;
config = (argc == 1 ? "configuration/default.conf" : argv[1]);
configFile.ConfigFileParse(config);
}
catch (std::string& e)
{
std::cout << e << std::endl;
return (1);
}
catch (std::exception& e)
{
std::cout << e.what() << std::endl;
}
}
else
{
std::cerr << "Error: wrong arguments" << std::endl;
return (1);
}
}