summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-10-04 09:40:16 +0200
committerdefault <nobody@localhost>2022-10-04 09:40:16 +0200
commitda7bf43385e900121aadbd90f6cb22d05c0cff5c (patch)
tree3f2ee74d5995099fcb74ca66728054556b86f092 /main.c
parentf1a7d9957d98df60639059ff97d71c47c423906a (diff)
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)
printf("Commands:\n");
printf("\n");
printf("init [{basedir}] Initializes the database\n");
+ printf("adduser {basedir} [{uid}] Adds a new user\n");
printf("httpd {basedir} Starts the HTTPD daemon\n");
printf("webfinger {basedir} {user} Queries about a @user@host or actor\n");
printf("queue {basedir} {uid} Processes a user queue\n");
@@ -23,7 +24,6 @@ int usage(void)
// printf("check {basedir} [{uid}] Checks the database\n");
// printf("purge {basedir} [{uid}] Purges old data\n");
-// printf("adduser {basedir} [{uid}] Adds a new user\n");
// printf("update {basedir} {uid} Sends a user update to followers\n");
// printf("passwd {basedir} {uid} Sets the password for {uid}\n");
@@ -71,9 +71,7 @@ int main(int argc, char *argv[])
/* ... */
basedir = GET_ARGV();
- initdb(basedir);
-
- return 0;
+ return initdb(basedir);
}
if ((basedir = GET_ARGV()) == NULL)
@@ -84,6 +82,14 @@ int main(int argc, char *argv[])
return 1;
}
+ if (strcmp(cmd, "adduser") == 0) {
+ user = GET_ARGV();
+
+ return adduser(user);
+
+ return 0;
+ }
+
if (strcmp(cmd, "httpd") == 0) {
httpd();
return 0;