]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - LinuxGUI/Ventoy2Disk/main_webui.c
Add theme plugin duplicate file check. (#2078)
[Ventoy.git] / LinuxGUI / Ventoy2Disk / main_webui.c
index e12208ef6c45d392517b2edaef55acd7050130f5..2b782cc5337d542e2a70da8850a87dfafa3daaa5 100644 (file)
@@ -7,12 +7,17 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/wait.h>
+#include <sys/types.h>
+#include <linux/limits.h>
 #include <ventoy_define.h>
 #include <ventoy_util.h>
 #include <ventoy_json.h>
 #include <ventoy_disk.h>
 #include <ventoy_http.h>
 
+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");