X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/dd2411d7d47fd72be78802cb28d6f0ef73785e9e..feea11e2bb2bc5f42ceca64255900e3917d87f98:/LinuxGUI/Ventoy2Disk/main_webui.c diff --git a/LinuxGUI/Ventoy2Disk/main_webui.c b/LinuxGUI/Ventoy2Disk/main_webui.c index e12208e..2b782cc 100644 --- a/LinuxGUI/Ventoy2Disk/main_webui.c +++ b/LinuxGUI/Ventoy2Disk/main_webui.c @@ -7,12 +7,17 @@ #include #include #include +#include +#include #include #include #include #include #include +char g_log_file[PATH_MAX]; +char g_ini_file[PATH_MAX]; + int ventoy_log_init(void); void ventoy_log_exit(void); @@ -30,6 +35,7 @@ void ventoy_signal_stop(int sig) int main(int argc, char **argv) { + int i; int rc; const char *ip = "127.0.0.1"; const char *port = "24680"; @@ -50,6 +56,20 @@ int main(int argc, char **argv) port = argv[2]; } + snprintf(g_log_file, sizeof(g_log_file), "log.txt"); + snprintf(g_ini_file, sizeof(g_ini_file), "./Ventoy2Disk.ini"); + for (i = 0; i < argc; i++) + { + if (argv[i] && argv[i + 1] && strcmp(argv[i], "-l") == 0) + { + snprintf(g_log_file, sizeof(g_log_file), "%s", argv[i + 1]); + } + else if (argv[i] && argv[i + 1] && strcmp(argv[i], "-i") == 0) + { + snprintf(g_ini_file, sizeof(g_ini_file), "%s", argv[i + 1]); + } + } + ventoy_log_init(); vlog("===============================================\n");