diff --git a/main.cpp b/main.cpp index 4d82857..905c92e 100644 --- a/main.cpp +++ b/main.cpp @@ -262,13 +262,16 @@ int findMyProc(const char *procname) { int main(int argc, char* argv[]) { for (int i = 0; i < argc; ++i) { std::string arg = argv[i]; + + if (i == 0 && argc > 1) { + continue; + } - // I'm really not a fan of microoptimizations, but we're putting check admin first to avoid all the other ifs. - // The compiler probably optimizes this anyway, but idk who cares lol + - if (arg == "-h" || arg == "--help" || argc == 1) { + if (argc == 1 || std::string(argv[1]) == "-h" || std::string(argv[1]) == "--help") { if (!forkAuthor.empty()) { std::cout << "\nwin-witr - Why is this running? Windows version by supervoidcoder. Fork by " << forkAuthor << std::endl; } else { @@ -305,7 +308,7 @@ int main(int argc, char* argv[]) { } - + return 0; // exit after printing help because it might try to process -help as a process name otherwise } @@ -361,6 +364,7 @@ int main(int argc, char* argv[]) { return 1; } + return 0; } // check for process name if no recognized flags else if (arg[0] != '-') { // if it doesn't start with -- or - diff --git a/main.exe b/main.exe index eb64783..1613368 100644 Binary files a/main.exe and b/main.exe differ diff --git a/main.obj b/main.obj index 138b0b9..c370615 100644 Binary files a/main.obj and b/main.obj differ diff --git a/vc140.pdb b/vc140.pdb index 111c0d8..b47d35a 100644 Binary files a/vc140.pdb and b/vc140.pdb differ