You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// contains function that checks if the stringy vector contains the thing its self explanatory
2093
2096
2094
2097
intmain(int argc, char* argv[]) {
2095
2098
SetConsoleOutputCP(CP_UTF8);
@@ -2150,13 +2153,21 @@ int main(int argc, char* argv[]) {
2150
2153
return0; // exit after printing help because it might try to process -help as a process name otherwise
2151
2154
}
2152
2155
2153
-
2156
+
// at this point, if help exists but is not the first argument we can assume the user is asking about a specific flag
2157
+
bool help = contains(args, "-help");
2158
+
2154
2159
if (args[1] == "-v" || args[1] == "-version") {
2160
+
if (!help) {
2155
2161
std::cout << "\nwin-witr " << version << std::endl;
2162
+
} else {
2163
+
std::cout << "Shows the version number of win-witr. If it says \"dev-build\", it means you compiled it yourself without a version number compiler environment variable.\n";
2164
+
2165
+
}
2156
2166
return0;
2157
2167
}
2158
2168
2159
2169
if (args[1] == "-pid") {
2170
+
if (!help) {
2160
2171
if (i + 1 < args.size()) {
2161
2172
2162
2173
std::string pidStr = args[i + 1]; // never increment the actual variable unless you're actually trying to find the next argument, otherwise
@@ -2213,9 +2224,14 @@ int main(int argc, char* argv[]) {
2213
2224
return1;
2214
2225
}
2215
2226
return0;
2216
-
}
2227
+
}
2228
+
else {
2229
+
std::cout << "Looks up a specific process based on the Process ID (PID) and returns information such as RAM usage, process ancestry, listening ports, and more.\n";
@@ -2232,6 +2248,10 @@ int main(int argc, char* argv[]) {
2232
2248
}
2233
2249
}
2234
2250
}
2251
+
} else {
2252
+
std::cout << "Looks up a process based on the name. The search is case-insensitive, and you do not need to type the .exe extension. If there are multiple processes with similar names, it will show them to you under \"Related Processes\" along with their PIDs so you can manually search up each one using the --pid flag.
0 commit comments