diff options
Diffstat (limited to '')
| -rw-r--r-- | main.c | 18 |
1 files changed, 17 insertions, 1 deletions
| @@ -18,12 +18,12 @@ int usage(void) | |||
| 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("adduser {basedir} [{uid}] Adds a new user\n"); |
| 20 | printf("httpd {basedir} Starts the HTTPD daemon\n"); | 20 | printf("httpd {basedir} Starts the HTTPD daemon\n"); |
| 21 | printf("purge {basedir} Purges old data\n"); | ||
| 21 | printf("webfinger {basedir} {user} Queries about a @user@host or actor\n"); | 22 | printf("webfinger {basedir} {user} Queries about a @user@host or actor\n"); |
| 22 | printf("queue {basedir} {uid} Processes a user queue\n"); | 23 | printf("queue {basedir} {uid} Processes a user queue\n"); |
| 23 | printf("follow {basedir} {uid} {actor} Follows an actor\n"); | 24 | printf("follow {basedir} {uid} {actor} Follows an actor\n"); |
| 24 | 25 | ||
| 25 | // printf("check {basedir} [{uid}] Checks the database\n"); | 26 | // printf("check {basedir} [{uid}] Checks the database\n"); |
| 26 | // printf("purge {basedir} [{uid}] Purges old data\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"); |
| @@ -95,6 +95,22 @@ int main(int argc, char *argv[]) | |||
| 95 | return 0; | 95 | return 0; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | if (strcmp(cmd, "purge") == 0) { | ||
| 99 | /* iterate all users */ | ||
| 100 | xs *list = user_list(); | ||
| 101 | char *p, *uid; | ||
| 102 | |||
| 103 | p = list; | ||
| 104 | while (xs_list_iter(&p, &uid)) { | ||
| 105 | if (user_open(&snac, uid)) { | ||
| 106 | purge(&snac); | ||
| 107 | user_free(&snac); | ||
| 108 | } | ||
| 109 | } | ||
| 110 | |||
| 111 | return 0; | ||
| 112 | } | ||
| 113 | |||
| 98 | if ((user = GET_ARGV()) == NULL) | 114 | if ((user = GET_ARGV()) == NULL) |
| 99 | return usage(); | 115 | return usage(); |
| 100 | 116 | ||