bool match_basename = false;
int64_t limit_matches = numeric_limits<int64_t>::max();
int64_t limit_left = numeric_limits<int64_t>::max();
+bool stdout_is_tty = false;
steady_clock::time_point start;
ZSTD_DDict *ddict = nullptr;
// the pattern and done a union of them, but that's a lot of
// work for fairly unclear gain.)
uint64_t matched = scan_all_docids(needles, fd, corpus);
+ dprintf("Done in %.1f ms, found %" PRId64 " matches.\n",
+ 1e3 * duration<float>(steady_clock::now() - start).count(), matched);
if (only_count) {
printf("%" PRId64 "\n", matched);
}
if (done)
return;
- uint32_t trgm __attribute__((unused)) = trgmptr.trgm;
+ uint32_t trgm = trgmptr.trgm;
const unsigned char *pldata = reinterpret_cast<const unsigned char *>(s.data());
size_t num = trgmptr.num_docids;
decoded.resize(num);
setlocale(LC_ALL, "");
for (;;) {
int option_index = 0;
- int c = getopt_long(argc, argv, "bcd:hil:n:0wVD", long_options, &option_index);
+ int c = getopt_long(argc, argv, "bcd:hil:n:0rwVD", long_options, &option_index);
if (c == -1) {
break;
}
}
}
+ if (!print_nul) {
+ stdout_is_tty = isatty(1);
+ }
+
vector<Needle> needles;
for (int i = optind; i < argc; ++i) {
Needle needle;