1- #include <stdio.h>
2- #include <stdlib.h>
3- #include <string.h>
4- #include <errno.h>
5- #include <limits.h>
6- #include "logging.h"
71#include "config.h"
2+ #include "helper.h" // for print_help, get_option_type, OPT_CONTAINER, OPT...
3+ #include "logging.h" // for log_msg, LOG_FATAL, parse_log_level, log_level
4+ #include <errno.h> // for errno, ERANGE
5+ #include <limits.h> // for INT_MAX, INT_MIN, LONG_MAX, LONG_MIN
6+ #include <stdio.h> // for fprintf, printf, stderr
7+ #include <stdlib.h> // for exit, free, getenv, malloc, strtol
8+ #include <string.h> // for strncpy, memmove, strlen
89
910int max_hops = MAX_HOPS_DEFAULT ;
1011int num_workers = NUM_WORKERS_DEFAULT ;
@@ -17,7 +18,7 @@ char gateway_name[64] = {0};
1718char suffix_domain [64 ] = {0 };
1819
1920// 初始化配置(环境变量)
20- void init_config_env () {
21+ void init_config_env (void ) {
2122
2223 // 从环境变量读取
2324 log_level = parse_log_level (getenv (LOG_LEVEL_ENV ), LOG_INFO );
@@ -203,7 +204,7 @@ void init_config_argc(int argc, char *argv[]) {
203204 print_help (argv [0 ]);
204205 exit (0 );
205206 case OPT_VERSION :
206- printf ( "version: %s\n" , VERSION );
207+ print_version ( );
207208 exit (0 );
208209 case OPT_UNKNOWN :
209210 fprintf (stderr , "Error: Unknown option '%s'\n" , argv [i ]);
0 commit comments