Closed SirTalksalot75 closed 1 month ago
Currently on hold.
(Based on a spontaneous idea)
May you please consider the following:
Instead of copying the arguments to a static buffer we can keep a copy of the argc
value and argv
pointer globally.
Since both are valid the entire duration of the app, we can search through them directly (instead of the static buffer).
// store argc and arg from main globally
int argc;
char** argv;
size_t check_option(const char* name) {
// directly search through argv
for (int i = 0; i < argc; i++) {
if (strcmp(name, argv[i] + 2) == 0) {
return 1;
}
}
return 0;
}
Development switched to @Servostar
added mechanism to save and read options globally