about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--scoop.14
-rw-r--r--scoop.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/scoop.1 b/scoop.1
index 693c033..480e8be 100644
--- a/scoop.1
+++ b/scoop.1
@@ -1,4 +1,4 @@
-.Dd April 28, 2021
+.Dd May  7, 2021
 .Dt SCOOP 1
 .Os
 .
@@ -148,7 +148,7 @@ Match events from users with the hostname
 .
 .It Fl l Ar limit
 Limit the number of events matched,
-ordered by most recent.
+ordered by most recently inserted.
 Implies
 .Fl s .
 .
diff --git a/scoop.c b/scoop.c
index f1c0ed2..241c566 100644
--- a/scoop.c
+++ b/scoop.c
@@ -510,7 +510,11 @@ int main(int argc, char *argv[]) {
 	}
 
 	if (limit) {
-		append(where, SQL(ORDER BY time DESC, event DESC LIMIT :limit));
+		if (optind < argc) {
+			append(where, SQL(ORDER BY search.rowid DESC LIMIT :limit));
+		} else {
+			append(where, SQL(ORDER BY event DESC LIMIT :limit));
+		}
 		binds[n++] = Bind(":limit", limit, 0);
 	}