From 8f19c223f6af7bb489b143bfd389282a7db0e476 Mon Sep 17 00:00:00 2001 From: Aris Date: Tue, 26 Dec 2023 17:11:20 +0000 Subject: [PATCH 1/3] Basic Implementation of GUI flag --- src/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 16634b8..b0f1da7 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,6 @@ #include #include +#include #include "scan.h" #include "window.h" @@ -103,7 +104,9 @@ int main(int argc, char **argv) closeLibraries(); return 0; } - if (argv[1][0] == '-' && (argv[1][1] == 'g' || argv[1][1] == 'G') && !argv[1][2] && argc >= 3){ + + int check = (int)ReadArgs((UBYTE *)"GUI/A", (LONG *)argv, NULL); + if (check > 0 && argc >= 3){ if (openLibraries()) { createWindow(argv[2]); @@ -126,5 +129,5 @@ int main(int argc, char **argv) void info(void) { - printf("Mnemosyne: Starts GUI Application\nMnemosyne (PATH): Scans Selected Path\nMnemosyne -g (PATH): Scans Selected Path in GUI\n"); + printf("Mnemosyne: Starts GUI Application\nMnemosyne (PATH): Scans Selected Path\nMnemosyne GUI (PATH): Scans Selected Path in GUI\n"); } From 54069fc61a2be415b0bc33e4f3ad9e03653726b7 Mon Sep 17 00:00:00 2001 From: Aris Date: Tue, 26 Dec 2023 19:05:21 +0000 Subject: [PATCH 2/3] No need to be stored in variable --- src/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index b0f1da7..1fa257b 100644 --- a/src/main.c +++ b/src/main.c @@ -104,9 +104,7 @@ int main(int argc, char **argv) closeLibraries(); return 0; } - - int check = (int)ReadArgs((UBYTE *)"GUI/A", (LONG *)argv, NULL); - if (check > 0 && argc >= 3){ + if ((int)ReadArgs((UBYTE *)"GUI/A", (LONG *)argv, NULL) > 0 && argc >= 3){ if (openLibraries()) { createWindow(argv[2]); From 4288c479e4b7e968fac4d8b27f3d9775e77945dc Mon Sep 17 00:00:00 2001 From: Aris Date: Tue, 26 Dec 2023 19:09:27 +0000 Subject: [PATCH 3/3] Moved priority of info up. Edited guide for GUI --- build/Mnemosyne.guide | 6 +++--- src/main.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/Mnemosyne.guide b/build/Mnemosyne.guide index 55a57ed..61b2ef7 100644 --- a/build/Mnemosyne.guide +++ b/build/Mnemosyne.guide @@ -138,14 +138,14 @@ There are 2 ways to use Mnemosyne: Where is the path to the directory you want to scan. - Using the -g CLI Flag: + Using the GUI CLI Keyword: ------------------------- - @{b}Mnemosyne -g @{ub} + @{b}Mnemosyne GUI @{ub} Where is the path to the directory you want to scan. - Adding the -g flag will open the GUI and start the scanning process. + Adding the GUI Keyword will open the GUI and start the scanning process. diff --git a/src/main.c b/src/main.c index 1fa257b..e1cc9b1 100644 --- a/src/main.c +++ b/src/main.c @@ -104,6 +104,11 @@ int main(int argc, char **argv) closeLibraries(); return 0; } + if (argv[1][0] == '?') + { + info(); + return 0; + } if ((int)ReadArgs((UBYTE *)"GUI/A", (LONG *)argv, NULL) > 0 && argc >= 3){ if (openLibraries()) { @@ -112,11 +117,6 @@ int main(int argc, char **argv) closeLibraries(); return 0; } - if (argv[1][0] == '?') - { - info(); - return 0; - } // Printf a line printf("\n----------------------------------------\n"); printf("Scanning: %s\n\n", argv[1]);