diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -78,6 +78,7 @@ main(int argc, char **argv) {'c', U8C("color"), CLI_NONE}, {'h', U8C("help"), CLI_NONE}, {'i', U8C("ignore-case"), CLI_NONE}, + {'l', U8C("literal"), CLI_NONE}, {'p', U8C("predicate"), CLI_NONE}, {'s', U8C("strip-newline"), CLI_NONE}, {'U', U8C("no-unicode"), CLI_NONE}, @@ -101,6 +102,9 @@ main(int argc, char **argv) case 'i': flags.i = true; break; + case 'l': + flags.l = true; + break; case 'p': flags.p = true; break; @@ -137,7 +141,7 @@ main(int argc, char **argv) if (argc == 0) { usage: - usage("[-p | -s | -z] [-bciU] pattern [file ...]", "-h"); + usage("[-p | -s | -z] [-bcilU] pattern [file ...]", "-h"); exit(EXIT_FATAL); } @@ -315,6 +319,8 @@ pattern_comp(u8view_t pat) | PCRE2_UTF; if (flags.i) reopts |= PCRE2_CASELESS; + if (flags.l) + reopts |= PCRE2_LITERAL; if (!flags.U) reopts |= PCRE2_UCP; @@ -432,4 +438,4 @@ getfstream(int globc, char **globv) close(fds[W]); return fdopen(fds[R], "r"); } -#endif /* GIT_GRAB */ +#endif /* GIT_GRAB */
\ No newline at end of file |