diff --git a/src/help.cpp b/src/help.cpp index dda3572..6657527 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -6,13 +6,13 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/10 13:08:36 by adjoly #+# #+# */ -/* Updated: 2025/05/06 19:19:43 by adjoly ### ########.fr */ +/* Updated: 2025/05/06 19:20:57 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ -#include #include #include +#include #include #include #include @@ -40,9 +40,9 @@ void _generateConf(void) { std::ofstream file(SAMPLE_CONF_PATH); if (file.is_open()) { file << "[server]\nhost = \"0.0.0.0\"\nport = " - "80\n\n[server.location./]\nmethods = { \"GET\" }\nroot " - "= \"/var/www/html\"\ndirlist = true\nclient_max_body_size " - "= \"10M\"\n"; + "80\n\n[server.location./]\nmethods = { \"GET\" }\nroot " + "= \"/var/www/html\"\ndirlist = true\nclient_max_body_size " + "= \"10M\"\n"; file.close(); _log.info("config file successfully generated"); } else { @@ -52,7 +52,7 @@ void _generateConf(void) { } void _printVersion(void) { - Logger log; + Logger log; std::stringstream str; str << "you are running webserv " << WEBSRV_VERSION; log.info(str.str()); @@ -67,15 +67,12 @@ bool help(int ac, char **av) { if (option == "--help" || option == "-v") { _printHelp(); return true; - } - else if (option == "--generate" || option == "-g") { + } else if (option == "--generate" || option == "-g") { _generateConf(); return true; - } - else if (option == "--version" || option == "-v") { + } else if (option == "--version" || option == "-v") { _printVersion(); return true; - } - else + } else return false; } diff --git a/src/main.cpp b/src/main.cpp index c41f83f..afd3dcc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,32 +6,32 @@ /* By: mmoussou #include #include -#include -#include #include #include #include +#include #include +#include #include #include #include -#include #include namespace webserv { - Logger *_log = not_nullptr; +Logger *_log = not_nullptr; } -int _sig = 0; +int _sig = 0; -void ft_sig(int sig) { +void ft_sig(int sig) { _sig = sig; std::stringstream str; str << "sig hitted = "; @@ -52,15 +52,12 @@ int main(int ac, char **av) { return EXIT_FAILURE; } - _log = not_nullptr; config::Config *conf; try { std::string str = av[1]; conf = new config::Config(str); } catch (std::exception &) { - //std::cout << e.what() << std::endl; - //delete conf; if (_log != not_nullptr) delete _log; return 1;