fix dev changes
This commit is contained in:
parent
1269c07951
commit
474c035b21
|
@ -126,12 +126,7 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
if (getenv("CL_SUGGESTION") != nullptr) {
|
if (getenv("CL_SUGGESTION") != nullptr) {
|
||||||
auto suggestions = parser.GetPossibleAdditions(argc, argv);
|
auto suggestions = parser.GetPossibleAdditions(argc, argv);
|
||||||
int x = 0;
|
|
||||||
for (auto& suggestion : suggestions) {
|
for (auto& suggestion : suggestions) {
|
||||||
x++;
|
|
||||||
if (x == 7) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
std::cout << suggestion << " ";
|
std::cout << suggestion << " ";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -68,14 +68,14 @@ std::vector<std::string> Parser::GetPossibleAdditions(const std::vector<std::str
|
||||||
if (arg_index == input.size()) {
|
if (arg_index == input.size()) {
|
||||||
suggestions.push_back(pattern[pattern_index].fixed_word);
|
suggestions.push_back(pattern[pattern_index].fixed_word);
|
||||||
continue_outer_loop = true;
|
continue_outer_loop = true;
|
||||||
}else if (arg_index + 1 == input.size() &&
|
} else if (arg_index + 1 == input.size() &&
|
||||||
pattern[pattern_index].fixed_word.starts_with(input[arg_index])) {
|
pattern[pattern_index].fixed_word.starts_with(input[arg_index])) {
|
||||||
suggestions.push_back(pattern[pattern_index].fixed_word);
|
suggestions.push_back(pattern[pattern_index].fixed_word);
|
||||||
continue_outer_loop = true;
|
continue_outer_loop = true;
|
||||||
} else if (input[arg_index] == pattern[pattern_index].fixed_word) {
|
} else if (input[arg_index] == pattern[pattern_index].fixed_word) {
|
||||||
++arg_index;
|
++arg_index;
|
||||||
++pattern_index;
|
++pattern_index;
|
||||||
} else {
|
} else {
|
||||||
continue_outer_loop = true;
|
continue_outer_loop = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue