diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-10-31 21:58:07 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-10-31 21:58:07 +0100 |
commit | 34400f2d328c2adfbfe13170989758e6f52208af (patch) | |
tree | d208f8b7d40cae2af4f38a9a295cb50c27c45abc /src/main.c | |
parent | c5cc1dab1d5610c0d96f72dc36ac6d4b4476c8ed (diff) |
Add the -l option
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 |