Minor code cleanup before continuing

This commit is contained in:
Trianta 2023-12-07 23:58:54 -06:00
parent 918909c1fa
commit 9ae148e5ee

View File

@ -3,22 +3,19 @@
void Generator::SetArguments(int argc, char* argv[]) {
std::string tempStr;
for (int i = 1; i < argc; ++i) {
for (int i = 1; i < argc; i += 2) {
tempStr.assign(argv[i]);
if (tempStr == "-i") {
setup.isFileSet = true;
++i;
setup.filename.assign(argv[i]);
setup.filename.assign(argv[i+1]);
}
if (tempStr == "-k") {
setup.isPrefixSet = true;
++i;
setup.prefixLength = std::stoi(argv[i]);
setup.prefixLength = std::stoi(argv[i+1]);
}
if (tempStr == "-n") {
setup.isOutputSet = true;
++i;
setup.outputLength = std::stoi(argv[i]);
setup.outputLength = std::stoi(argv[i+1]);
}
if (tempStr == "-h") {
PrintUsage();