260915.2 · 1739556b7485df48bde0c256ae9c76096b3f537b
update matching mode flags logic
- make mode flags -E, -F, -G, -P respect order on the command line to permit overriding (like BSD grep)
- warn when used in a config file #562
reading declarations
Changes to src/stats.cpp. All files
@@ -100,16 +100,18 @@ void Stats::report(FILE *output) for (const auto& i : flag_config_files) fprintf(output, " using %s" NEWLINESTR, i.c_str()); }+ if (flag_fuzzy > 0)+ fprintf(output, " --fuzzy" NEWLINESTR); if (flag_bool) fprintf(output, " --bool %s" NEWLINESTR, (flag_files ? "--files" : "--lines"));- if (flag_basic_regexp)+ if (flag_mode == Mode::BRE) fprintf(output, " --basic-regexp" NEWLINESTR);- else if (flag_fixed_strings)+ else if (flag_mode == Mode::FIXED) fprintf(output, " --fixed-strings" NEWLINESTR);- else if (flag_fuzzy > 0)- fprintf(output, " --fuzzy" NEWLINESTR);- else if (flag_perl_regexp)+ else if (flag_mode == Mode::PERL) fprintf(output, " --perl-regexp" NEWLINESTR);+ else+ fprintf(output, " --extended-regexp" NEWLINESTR); if (flag_decompress) fprintf(output, " --decompress --zmax=%zu" NEWLINESTR, flag_zmax); if (flag_min_depth > 0 && flag_max_depth > 0)