🔨」 fix: fixed some things.

This commit is contained in:
2025-05-06 19:29:36 +02:00
parent ec1299ccfa
commit 8ef2803075
2 changed files with 16 additions and 22 deletions

View File

@ -6,13 +6,13 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 <log.hpp>
#include <fstream>
#include <help.hpp>
#include <log.hpp>
#include <sstream>
#include <sys/stat.h>
#include <unistd.h>
@ -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;
}

View File

@ -6,23 +6,23 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/03 15:45:07 by mmoussou #+# #+# */
/* Updated: 2025/05/06 19:19:33 by adjoly ### ########.fr */
/* Updated: 2025/05/06 19:20:55 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "cppeleven.hpp"
#include <config/Config.hpp>
#include <config/default.hpp>
#include <csignal>
#include <server/default.hpp>
#include <config/Config.hpp>
#include <cstdlib>
#include <exception>
#include <help.hpp>
#include <log.hpp>
#include <requests/default.hpp>
#include <server/default.hpp>
#include <sstream>
#include <tomlpp.hpp>
#include <unistd.h>
#include <log.hpp>
#include <webserv.hpp>
namespace webserv {
@ -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;