summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar default2022-10-04 09:40:16 +0200
committerGravatar default2022-10-04 09:40:16 +0200
commitda7bf43385e900121aadbd90f6cb22d05c0cff5c (patch)
tree3f2ee74d5995099fcb74ca66728054556b86f092 /main.c
parentUpdated Makefile. (diff)
downloadsnac2-da7bf43385e900121aadbd90f6cb22d05c0cff5c.tar.gz
snac2-da7bf43385e900121aadbd90f6cb22d05c0cff5c.tar.xz
snac2-da7bf43385e900121aadbd90f6cb22d05c0cff5c.zip
New function adduser().
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/main.c b/main.c
index 64de82c..18c7c22 100644
--- a/main.c
+++ b/main.c
@@ -16,6 +16,7 @@ int usage(void)
16 printf("Commands:\n"); 16 printf("Commands:\n");
17 printf("\n"); 17 printf("\n");
18 printf("init [{basedir}] Initializes the database\n"); 18 printf("init [{basedir}] Initializes the database\n");
19 printf("adduser {basedir} [{uid}] Adds a new user\n");
19 printf("httpd {basedir} Starts the HTTPD daemon\n"); 20 printf("httpd {basedir} Starts the HTTPD daemon\n");
20 printf("webfinger {basedir} {user} Queries about a @user@host or actor\n"); 21 printf("webfinger {basedir} {user} Queries about a @user@host or actor\n");
21 printf("queue {basedir} {uid} Processes a user queue\n"); 22 printf("queue {basedir} {uid} Processes a user queue\n");
@@ -23,7 +24,6 @@ int usage(void)
23 24
24// printf("check {basedir} [{uid}] Checks the database\n"); 25// printf("check {basedir} [{uid}] Checks the database\n");
25// printf("purge {basedir} [{uid}] Purges old data\n"); 26// printf("purge {basedir} [{uid}] Purges old data\n");
26// printf("adduser {basedir} [{uid}] Adds a new user\n");
27 27
28// printf("update {basedir} {uid} Sends a user update to followers\n"); 28// printf("update {basedir} {uid} Sends a user update to followers\n");
29// printf("passwd {basedir} {uid} Sets the password for {uid}\n"); 29// printf("passwd {basedir} {uid} Sets the password for {uid}\n");
@@ -71,9 +71,7 @@ int main(int argc, char *argv[])
71 /* ... */ 71 /* ... */
72 basedir = GET_ARGV(); 72 basedir = GET_ARGV();
73 73
74 initdb(basedir); 74 return initdb(basedir);
75
76 return 0;
77 } 75 }
78 76
79 if ((basedir = GET_ARGV()) == NULL) 77 if ((basedir = GET_ARGV()) == NULL)
@@ -84,6 +82,14 @@ int main(int argc, char *argv[])
84 return 1; 82 return 1;
85 } 83 }
86 84
85 if (strcmp(cmd, "adduser") == 0) {
86 user = GET_ARGV();
87
88 return adduser(user);
89
90 return 0;
91 }
92
87 if (strcmp(cmd, "httpd") == 0) { 93 if (strcmp(cmd, "httpd") == 0) {
88 httpd(); 94 httpd();
89 return 0; 95 return 0;