X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=ctdlsh%2Fmain.c;h=cda33ec44c1fff20c562b3d02dc04576afbf815e;hb=HEAD;hp=daa356833127cc2acfd08e274f61af719a641a5f;hpb=93f719e3132da1eb448f7ca27c852fbe0953a63c;p=citadel.git diff --git a/ctdlsh/main.c b/ctdlsh/main.c index daa356833..7e1d93e5b 100644 --- a/ctdlsh/main.c +++ b/ctdlsh/main.c @@ -1,5 +1,5 @@ /* - * (c) 2009-2019 by Art Cancro and citadel.org + * (c) 2009-2020 by Art Cancro and citadel.org * This program is open source. It runs great on the Linux operating system. * It's released under the General Public License (GPL) version 3. */ @@ -17,17 +17,17 @@ typedef struct { } COMMAND; COMMAND commands[] = { - {"?", cmd_help, "Display this message"}, - {"help", cmd_help, "Display this message"}, - {"date", cmd_datetime, "Print the server's date and time"}, - {"config", cmd_config, "Configure the Citadel server"}, - {"export", cmd_export, "Export all Citadel databases"}, - {"shutdown", cmd_shutdown, "Shut down the Citadel server"}, - {"time", cmd_datetime, "Print the server's date and time"}, - {"passwd", cmd_passwd, "Set or change an account password"}, - {"who", cmd_who, "Display a list of online users"}, - {"mailq", cmd_mailq, "Show the outbound email queue"}, - {NULL, NULL, NULL} + { "?", cmd_help, "Display this message" }, + { "help", cmd_help, "Display this message" }, + { "date", cmd_datetime, "Print the server's date and time" }, + { "config", cmd_config, "Configure the Citadel server" }, + { "export", cmd_export, "Export all Citadel databases" }, + { "shutdown", cmd_shutdown, "Shut down the Citadel server" }, + { "time", cmd_datetime, "Print the server's date and time" }, + { "passwd", cmd_passwd, "Set or change an account password" }, + { "who", cmd_who, "Display a list of online users" }, + { "mailq", cmd_mailq, "Show the outbound email queue" }, + { NULL, NULL, NULL } }; @@ -97,7 +97,8 @@ void do_main_loop(int server_socket) sock_getln(server_socket, buf, sizeof buf); if (buf[0] == '1') { i = 0; - while (sock_getln(server_socket, buf, sizeof buf), strcmp(buf, "000")) { + while (sock_getln(server_socket, buf, sizeof buf), + strcmp(buf, "000")) { if (i == 1) { sprintf(prompt, "\n%s> ", buf); } @@ -107,7 +108,7 @@ void do_main_loop(int server_socket) /* Here we go ... main command loop */ rl_attempted_completion_function = command_name_completion; - while ( (cmd = readline(prompt)) , cmd ) { + while ((cmd = readline(prompt)), cmd) { if (*cmd) { add_history(cmd); ret = do_one_command(server_socket, cmd); @@ -143,9 +144,10 @@ int main(int argc, char **argv) int is_interactive = ((strlen(cmd) == 0) ? 1 : 0); if (is_interactive) { - printf("\nCitadel administration shell (c) 2009-2019 by citadel.org\n" - "This is open source software made available to you under the terms\n" - "of the GNU General Public License v3. All other rights reserved.\n"); + printf + ("\nCitadel administration shell (c) 2009-2020 by citadel.org\n" + "This is open source software made available to you under the terms\n" + "of the GNU General Public License v3. All other rights reserved.\n"); printf("Connecting to Citadel server in %s...\n", ctdldir); }