summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-31 19:07:39 -0500
committerJune McEnroe <june@causal.agency>2019-12-31 19:07:39 -0500
commit04d61591029d68300e0b93c4f9936402921090c5 (patch)
tree950be5d630e621a85261fe918d1ba34be672f218
parentAdd scoop IRC output format (diff)
downloadlitterbox-04d61591029d68300e0b93c4f9936402921090c5.tar.gz
litterbox-04d61591029d68300e0b93c4f9936402921090c5.zip
Add before and after options
Diffstat (limited to '')
-rw-r--r--scoop.112
-rw-r--r--scoop.c6
2 files changed, 17 insertions, 1 deletions
diff --git a/scoop.1 b/scoop.1
index febeecc..1ab6dca 100644
--- a/scoop.1
+++ b/scoop.1
@@ -13,6 +13,8 @@
 .Op Fl F Ar format
 .Op Fl N Ar network
 .Op Fl T Ar target
+.Op Fl a Ar time
+.Op Fl b Ar time
 .Op Fl c Ar context
 .Op Fl d Ar path
 .Op Fl f Ar format
@@ -74,6 +76,16 @@ or
 with
 .Ar target .
 .
+.It Fl a Ar time
+Match events which occurred after
+.Ar time
+in ISO8601 format.
+.
+.It Fl b Ar time
+Match events which occurred before
+.Ar time
+in ISO8601 format.
+.
 .It Fl c Ar context
 Match events from
 .Ar context ,
diff --git a/scoop.c b/scoop.c
index e33da1c..f75a32c 100644
--- a/scoop.c
+++ b/scoop.c
@@ -202,6 +202,8 @@ static const char *Inner = SQL(
 		AND coalesce(contexts.name = :context, true)
 		AND coalesce(contexts.query = :query, true)
 		AND coalesce(date(events.time) = date(:date), true)
+		AND coalesce(events.time >= datetime(:after), true)
+		AND coalesce(events.time <= datetime(:before), true)
 		AND coalesce(events.type = :type, true)
 		AND coalesce(names.nick = :nick, true)
 		AND coalesce(names.user = :user, true)
@@ -276,12 +278,14 @@ int main(int argc, char *argv[]) {
 	const char *search = NULL;
 
 	int opt;
-	while (0 < (opt = getopt(argc, argv, "D:F:N:T:c:d:f:gh:l:n:pqst:u:v"))) {
+	while (0 < (opt = getopt(argc, argv, "D:F:N:T:a:b:c:d:f:gh:l:n:pqst:u:v"))) {
 		switch (opt) {
 			break; case 'D': binds[n++] = Bind(":date", optarg, 0);
 			break; case 'F': binds[n++] = Bind(":format", optarg, 0);
 			break; case 'N': binds[n++] = Bind(":network", optarg, 0);
 			break; case 'T': binds[n++] = Bind(":target", optarg, 0);
+			break; case 'a': binds[n++] = Bind(":after", optarg, 0);
+			break; case 'b': binds[n++] = Bind(":before", optarg, 0);
 			break; case 'c': binds[n++] = Bind(":context", optarg, 0);
 			break; case 'd': path = optarg;
 			break; case 'f': format = parseFormat(optarg);
'2021-05-08 17:21:05 -0400'>2021-05-08Update to OpenBSD 6.9June McEnroe 2021-04-26Update to Linux man-pages 5.11June McEnroe 2021-04-26Update to FreeBSD 13.0June McEnroe 2021-01-27Completely rewrite how manuals are fetched and installedJune McEnroe 2020-12-14Update to man-pages-posix 2017-aJune McEnroe 2020-12-14Update to OpenBSD 6.8June McEnroe 2020-12-14Update to NetBSD 9.1June McEnroe 2020-12-14Update to man-pages 5.09June McEnroe 2020-12-14Update to FreeBSD 12.2June McEnroe 2020-06-08Update to OpenBSD 6.7June McEnroe 2020-05-04Add hack for macOS to search extra man sectionsJune McEnroe 2020-05-04Don't clear MANSECTJune McEnroe