aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/flags.h1
-rw-r--r--src/main.c10
2 files changed, 9 insertions, 2 deletions
diff --git a/src/flags.h b/src/flags.h
index 306464c..fbd957d 100644
--- a/src/flags.h
+++ b/src/flags.h
@@ -5,6 +5,7 @@ typedef struct {
bool b : 1;
bool c : 1;
bool i : 1;
+ bool l : 1;
bool p : 1;
bool s : 1;
bool U : 1;
diff --git a/src/main.c b/src/main.c
index e679839..9e7e522 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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