don't remember what i tried doing but it broke so here

master
ieee 802.11ac 2 years ago
parent 4a7d031c6d
commit d2c73ba62d

@ -1,6 +1,7 @@
/*
behold! my garbage code. (and other people's better code but whatever)
*/
#include <cstdlib>
#include <iostream>
#include <sys/ioctl.h>
#include <string.h>
@ -30,13 +31,23 @@ int main(int argc, char **argv)
std::cout << argc-1 << " arguments" << std::endl;
for (int i = 1; i < argc; i++) {
char* arg = argv[i];
std::string argMidstep = arg;
std::vector<char> argBrokenDown(argMidstep.begin(), argMidstep.end());
bool argMultiOption = false;
if (!strcmp(&argBrokenDown[0], "-")) {
argMultiOption = true;
}
if (!strcmp(arg, "--help")) {
std::cout << "this is a factorio clone that runs in the terminal. it is shit. shoutouts to dragon lord for thinking up the name \"beaurocra-tech\"" << std::endl;
std::cout << "syntax: " << filename << " [arguments] <*.json>" << std::endl; // why json? because 1. it's convenient and 2. i'm too lazy to make a blotterv5 parser
break;
} else if (!strcmp(arg, "--debug")) {
std::cout << "default path: " << defaultPath << std::endl;
} else if (argMultiOption) {
for (int i = 0; i < sizeof(argBrokenDown); i++) {
if (!strcmp(arg, "--debug") | !strcmp(&argBrokenDown[i], "d")) {
std::cout << "default path: " << defaultPath << std::endl;
}
}
}
}
}

Loading…
Cancel
Save