More acurately represents what it really does.
| ... | ... |
@@ -195,7 +195,7 @@ static struct option longopts[] = {{"show-matches", required_argument, NULL, 'e'
|
| 195 | 195 |
|
| 196 | 196 |
int main(int argc, char *argv[]) {
|
| 197 | 197 |
int benchmark = 0; |
| 198 |
- const char *initial_query = NULL; |
|
| 198 |
+ const char *filter = NULL; |
|
| 199 | 199 |
const char *tty_filename = "/dev/tty"; |
| 200 | 200 |
char c; |
| 201 | 201 |
while ((c = getopt_long(argc, argv, "vhse:l:t:p:", longopts, NULL)) != -1) {
|
| ... | ... |
@@ -207,7 +207,7 @@ int main(int argc, char *argv[]) {
|
| 207 | 207 |
flag_show_scores = 1; |
| 208 | 208 |
break; |
| 209 | 209 |
case 'e': |
| 210 |
- initial_query = optarg; |
|
| 210 |
+ filter = optarg; |
|
| 211 | 211 |
break; |
| 212 | 212 |
case 'b': |
| 213 | 213 |
if (optarg) {
|
| ... | ... |
@@ -256,14 +256,14 @@ int main(int argc, char *argv[]) {
|
| 256 | 256 |
num_lines = choices.size; |
| 257 | 257 |
|
| 258 | 258 |
if (benchmark) {
|
| 259 |
- if (!initial_query) {
|
|
| 259 |
+ if (!filter) {
|
|
| 260 | 260 |
fprintf(stderr, "Must specify -e/--show-matches with --benchmark\n"); |
| 261 | 261 |
exit(EXIT_FAILURE); |
| 262 | 262 |
} |
| 263 | 263 |
for (int i = 0; i < benchmark; i++) |
| 264 |
- choices_search(&choices, initial_query); |
|
| 265 |
- } else if (initial_query) {
|
|
| 266 |
- choices_search(&choices, initial_query); |
|
| 264 |
+ choices_search(&choices, filter); |
|
| 265 |
+ } else if (filter) {
|
|
| 266 |
+ choices_search(&choices, filter); |
|
| 267 | 267 |
for (size_t i = 0; i < choices_available(&choices); i++) {
|
| 268 | 268 |
if (flag_show_scores) |
| 269 | 269 |
printf("%f\t", choices_getscore(&choices, i));
|