Skip to content

Commit 4244dee

Browse files
fix: πŸ˜’πŸ™
1 parent 76c9068 commit 4244dee

1 file changed

Lines changed: 3 additions & 23 deletions

File tree

β€Žmain.cppβ€Ž

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,10 +2089,7 @@ std::vector<std::string> normalizeArgs(std::vector<std::string>& args) {
20892089
return args;
20902090
}
20912091

2092-
bool contains(const std::vector<std::string>& v, const std::string& value) {
2093-
return std::find(v.begin(), v.end(), value) != v.end();
2094-
}
2095-
// contains function that checks if the stringy vector contains the thing its self explanatory
2092+
20962093

20972094
int main(int argc, char* argv[]) {
20982095
SetConsoleOutputCP(CP_UTF8);
@@ -2153,21 +2150,13 @@ int main(int argc, char* argv[]) {
21532150
return 0; // exit after printing help because it might try to process -help as a process name otherwise
21542151
}
21552152

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-
2153+
21592154
if (args[1] == "-v" || args[1] == "-version") {
2160-
if (!help) {
21612155
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-
}
21662156
return 0;
21672157
}
21682158

21692159
if (args[1] == "-pid") {
2170-
if (!help) {
21712160
if (i + 1 < args.size()) {
21722161

21732162
std::string pidStr = args[i + 1]; // never increment the actual variable unless you're actually trying to find the next argument, otherwise
@@ -2224,14 +2213,9 @@ int main(int argc, char* argv[]) {
22242213
return 1;
22252214
}
22262215
return 0;
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";
2230-
2231-
}}
2216+
}
22322217
// check for process name if no recognized flags
22332218
else {
2234-
if (!help) {
22352219
std::string procName = args[1];
22362220
HANDLE hshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
22372221
if (INVALID_HANDLE_VALUE == hshot) {return 1;}
@@ -2248,10 +2232,6 @@ int main(int argc, char* argv[]) {
22482232
}
22492233
}
22502234
}
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.\n";
2253-
2254-
}
22552235
}
22562236
return 0;
22572237

0 commit comments

Comments
Β (0)