summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--scoop.112
-rw-r--r--scoop.c8
2 files changed, 16 insertions, 4 deletions
diff --git a/scoop.1 b/scoop.1
index 0298232..2b274bc 100644
--- a/scoop.1
+++ b/scoop.1
@@ -1,4 +1,4 @@
-.Dd May 17, 2021
+.Dd May 18, 2021
 .Dt SCOOP 1
 .Os
 .
@@ -8,7 +8,7 @@
 .
 .Sh SYNOPSIS
 .Nm
-.Op Fl Lgpqrsv
+.Op Fl Lgipqrsv
 .Op Fl D Ar date
 .Op Fl F Ar format
 .Op Fl N Ar network
@@ -145,6 +145,11 @@ Implies
 Match events from users with the hostname
 .Ar host .
 .
+.It Fl i
+Use case-insensitive regular expression matching
+with
+.Fl m .
+.
 .It Fl l Ar limit
 Limit the number of events matched,
 ordered by most recently inserted.
@@ -157,6 +162,9 @@ matching the modern regular expression
 .Ar regexp .
 See
 .Xr re_format 7 .
+To match case-insensitively,
+use with
+.Fl i .
 .
 .It Fl n Ar nick
 Match events from users with the nickname
diff --git a/scoop.c b/scoop.c
index 6d06499..031e4e2 100644
--- a/scoop.c
+++ b/scoop.c
@@ -245,6 +245,7 @@ static void regexpFree(void *_regex) {
 	free(regex);
 }
 
+static int regexpFlags = REG_EXTENDED | REG_NOSUB;
 static void regexp(sqlite3_context *ctx, int n, sqlite3_value *args[]) {
 	assert(n == 2);
 	if (sqlite3_value_type(args[0]) == SQLITE_NULL) {
@@ -267,7 +268,7 @@ static void regexp(sqlite3_context *ctx, int n, sqlite3_value *args[]) {
 
 		int error = regcomp(
 			regex, (const char *)sqlite3_value_text(args[0]),
-			REG_EXTENDED | REG_NOSUB
+			regexpFlags
 		);
 		if (error) {
 			char msg[256];
@@ -368,7 +369,7 @@ int main(int argc, char *argv[]) {
 	struct Bind *binds = calloc(argc + 2, sizeof(*binds));
 	if (!binds) err(EX_OSERR, "calloc");
 
-	const char *Opts = "D:F:LN:ST:a:b:c:d:f:gh:l:m:n:pqrst:u:vw:";
+	const char *Opts = "D:F:LN:ST:a:b:c:d:f:gh:il:m:n:pqrst:u:vw:";
 	for (int opt; 0 < (opt = getopt(argc, argv, Opts));) {
 		switch (opt) {
 			break; case 'D': {
@@ -453,6 +454,9 @@ int main(int argc, char *argv[]) {
 				append(where, SQL(AND names.host = :host));
 				binds[n++] = Bind(":host", optarg, 0);
 			}
+			break; case 'i': {
+				regexpFlags |= REG_ICASE;
+			}
 			break; case 'l': {
 				limit = optarg;
 				sort = true;
le='2015-08-13 15:40:27 +0200'>2015-08-13ui-shared: show full date in tooltip if longer ago than max_relativeJohn Keeping 2015-08-13ui-shared: use common function in print_rel_date()John Keeping 2015-08-13ui-shared: extract date formatting to a functionJohn Keeping 2015-08-13filter: don't use dlsym unnecessarilyJohn Keeping 2015-08-13ui-tree: use "sane" isgraph()John Keeping 2015-08-13cgit.h: move stdbool.h from ui-shared.hJohn Keeping 2015-08-13cache.c: fix header orderJohn Keeping 2015-08-13configfile.c: don't include system headers directlyJohn Keeping 2015-08-13Remove redundant includesJohn Keeping 2015-08-13Makefile: include Git's config.mak.unameJohn Keeping 2015-08-13tests: allow shell to be overriddenJohn Keeping 2015-08-13redirect: cleanlinessJason A. Donenfeld 2015-08-13redirect: be more careful for different cgi setupsJason A. Donenfeld 2015-08-12ui-log: fix double countingJohn Keeping 2015-08-12log: allow users to follow a fileJohn Keeping 2015-08-12shared: make cgit_diff_tree_cb publicJohn Keeping 2015-08-12t0110: Chain together using &&Jason A. Donenfeld 2015-08-12about: always ensure page has a trailing slashJason A. Donenfeld 2015-08-12filters: apply HTML escapingLazaros Koromilas 2015-08-12git: update to v2.5.0Christian Hesse 2015-08-12Fix processing of repo.hide and repo.ignoreDaniel Reichelt