diff --git a/.gitignore b/.gitignore index 9150b75..f85da30 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,5 @@ *.app build -.cache/ \ No newline at end of file +.cache/ +*.core \ No newline at end of file diff --git a/src/cli.cpp b/src/cli.cpp index 84f2d2a..e151b0c 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -89,10 +89,10 @@ int CLI::help(vector entries) { // application side function... int CLI::parse(vector entries, vector args) { // if no args then stop, no need to be wasting time. - if(args.size() == 0) { + if(args.size() == 0 && debug != true) { error("No arguments provided... Please use --help"); exit(1); - } + } // Iterate over args provided... for(int i = 0; i < args.size(); i++) { // Hardcoded debugging command. Useful for developers... @@ -115,8 +115,10 @@ int CLI::parse(vector entries, vector args) { } if(args[i] == entries[j].shand) { entries[j].func(); + return(0); } else if (args[i] == entries[j].lhand) { entries[j].func(); + return(0); } // This specific clause is needed for the debug to work // without interrupting the program flow.