fix: typo in config parser concerning the --default_file flag

This commit is contained in:
Gu://em_ 2025-11-20 18:32:38 +01:00
parent 0982f2bf3a
commit 747b3f7698
2 changed files with 17 additions and 15 deletions

View file

@ -7,3 +7,4 @@ server_name = my_server
ip = 127.0.0.1 ip = 127.0.0.1
port = 6996 port = 6996
root_dir = . root_dir = .
default_file='/dev/null'

View file

@ -180,21 +180,22 @@ static void print_arg_error(int err, char **argv, struct option options[],
struct config *parse_configuration(int argc, char *argv[]) struct config *parse_configuration(int argc, char *argv[])
{ {
struct option options[] = { // Global struct option options[] = {
{ "daemon", required_argument, NULL, 'd' }, // Global
{ "help", no_argument, NULL, 'h' }, { "daemon", required_argument, NULL, 'd' },
// Vhosts { "help", no_argument, NULL, 'h' },
{ "server_name", required_argument, NULL, 's' }, // Vhosts
{ "port", required_argument, NULL, 'p' }, { "server_name", required_argument, NULL, 's' },
{ "ip", required_argument, NULL, 'i' }, { "port", required_argument, NULL, 'p' },
{ "root_dir", required_argument, NULL, 'r' }, { "ip", required_argument, NULL, 'i' },
{ "defaut_file", required_argument, NULL, 'D' }, { "root_dir", required_argument, NULL, 'r' },
// Logging { "default_file", required_argument, NULL, 'D' },
{ "pid_file", required_argument, NULL, 'P' }, // Logging
{ "log_file", required_argument, NULL, 'L' }, { "pid_file", required_argument, NULL, 'P' },
{ "log", required_argument, NULL, 'l' }, { "log_file", required_argument, NULL, 'L' },
// End { "log", required_argument, NULL, 'l' },
{ NULL, 0, NULL, 0 } // End
{ NULL, 0, NULL, 0 }
}; };
struct config *config = calloc(1, sizeof(struct config)); struct config *config = calloc(1, sizeof(struct config));