@@ -71,9 +71,9 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path,
7171 opterr = 0 ;
7272
7373 static struct option long_options [] = {
74- {"help" , no_argument , 0 , 'h' },
7574 {"config" , required_argument , 0 , 'c' }, // required option
7675 {"foreground" , no_argument , 0 , 'f' },
76+ {"help" , no_argument , 0 , 'h' },
7777 {"log-backend" , required_argument , 0 , 'l' }, // optional, defaults to syslog
7878 {"version" , no_argument , 0 , 'v' },
7979 {0 , 0 , 0 , 0 }
@@ -89,9 +89,6 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path,
8989 while ((opt = getopt_long (argc , argv , ":" , long_options , NULL )) != -1 ) {
9090
9191 switch (opt ) {
92- case 'h' :
93- print_help ();
94- exit (0 );
9592
9693 case 'c' :
9794 * cfg_file_path = optarg ;
@@ -102,6 +99,10 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path,
10299 * run_in_foreground = true;
103100 break ;
104101
102+ case 'h' :
103+ print_help ();
104+ exit (0 );
105+
105106 case 'l' :
106107 if (strcmp (optarg , "syslog" ) == 0 ) {
107108 * log_backend = LOG_BACKEND_SYSLOG ;
0 commit comments