summary refs log tree commit diff
path: root/server.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-07-10 11:54:33 -0400
committerJune McEnroe <june@causal.agency>2020-07-10 11:54:33 -0400
commitdffae725026a5f19303c36d5250779cf5e8523ab (patch)
tree6b4bc6a0172cd0e8e9a6d26fa1f01176d7153a17 /server.c
parentMove search help to footer (diff)
downloadscooper-dffae725026a5f19303c36d5250779cf5e8523ab.tar.gz
scooper-dffae725026a5f19303c36d5250779cf5e8523ab.zip
Add -l and -r options
Diffstat (limited to '')
-rw-r--r--server.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/server.c b/server.c
index ac8fc4f..4955524 100644
--- a/server.c
+++ b/server.c
@@ -47,6 +47,7 @@ const struct kvalid Keys[KeysLen] = {
 
 bool pagePublic;
 int pageLimit = 100;
+int pageRecent = 500;
 
 static const char CSS[] = {
 #include "default.css.h"
@@ -77,11 +78,13 @@ int main(int argc, char *argv[]) {
 	bool fastCGI = false;
 	bool test = false;
 
-	for (int opt; 0 < (opt = getopt(argc, argv, "cfps:"));) {
+	for (int opt; 0 < (opt = getopt(argc, argv, "cfl:pr:s:"));) {
 		switch (opt) {
 			break; case 'c': test = true;
 			break; case 'f': fastCGI = true;
+			break; case 'l': pageLimit = strtol(optarg, NULL, 10);
 			break; case 'p': pagePublic = true;
+			break; case 'r': pageRecent = strtol(optarg, NULL, 10);
 			break; case 's': htmlStylesheet = optarg;
 			break; default:  return EX_USAGE;
 		}
Day 7June McEnroe 2020-11-22Day 6, part 2June McEnroe 2020-11-22Day 6June McEnroe 2020-11-22Day 5, part 2June McEnroe 2020-11-22Day 5June McEnroe 2020-11-22Day 4, part 2June McEnroe That ugly sort map though. 2020-11-22Day 4June McEnroe 2020-11-22Day 3, part 2June McEnroe I am super surprised that worked on the first try. 2020-11-22Day 3, clean upJune McEnroe 2020-11-22Day 3June McEnroe This is fucking awful and I'm angry. 2020-11-22Day 2, part 2June McEnroe 2020-11-22Day 2June McEnroe 2020-11-22Day 1, part 2June McEnroe 2020-11-22Day 1June McEnroe 2020-11-22Move to 2016 directoryJune McEnroe