Skip to content

Commit

Permalink
Merge pull request #17 from Arisamiga/gui-arg
Browse files Browse the repository at this point in the history
Basic ReImplementation of GUI flag
  • Loading branch information
Arisamiga authored Dec 27, 2023
2 parents 2958b22 + 4288c47 commit 7794b48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions build/Mnemosyne.guide
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ There are 2 ways to use Mnemosyne:
Where <path> is the path to the directory you want to scan.


Using the -g CLI Flag:
Using the GUI CLI Keyword:
-------------------------

@{b}Mnemosyne -g <path>@{ub}
@{b}Mnemosyne GUI <path>@{ub}

Where <path> 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.



Expand Down
15 changes: 8 additions & 7 deletions src/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <proto/exec.h>
#include <proto/dos.h>

#include "scan.h"
#include "window.h"
Expand Down Expand Up @@ -103,19 +104,19 @@ 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){
if (argv[1][0] == '?')
{
info();
return 0;
}
if ((int)ReadArgs((UBYTE *)"GUI/A", (LONG *)argv, NULL) > 0 && argc >= 3){
if (openLibraries())
{
createWindow(argv[2]);
}
closeLibraries();
return 0;
}
if (argv[1][0] == '?')
{
info();
return 0;
}
// Printf a line
printf("\n----------------------------------------\n");
printf("Scanning: %s\n\n", argv[1]);
Expand All @@ -126,5 +127,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");
}

0 comments on commit 7794b48

Please sign in to comment.