diff options
author | Ben Burwell <bburwell1@gmail.com> | 2013-05-01 15:39:02 -0400 |
---|---|---|
committer | Ben Burwell <bburwell1@gmail.com> | 2013-05-01 15:39:02 -0400 |
commit | d096b7ac4a2435339f7a7e3de68c51efc07422a0 (patch) | |
tree | 77baaffeb0f75e401ee89849daa0f4bc4d3d99af /user_command.h | |
parent | 79230604a20409ab12c2cb9620df81078ff7fae2 (diff) |
It's beautiful. But actually. Oh my god.
Diffstat (limited to 'user_command.h')
-rw-r--r-- | user_command.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/user_command.h b/user_command.h index 0854a70..803fada 100644 --- a/user_command.h +++ b/user_command.h @@ -41,7 +41,6 @@ void process_user_command() { // reset prompt strcpy(prompt, ">"); - printf("\n > "); } else { @@ -55,9 +54,9 @@ void process_user_command() { } - if (strcmp(command, "quit\n") == 0) { + if (strcmp(command, "quit\n") == 0 || strcmp(command, "q\n") == 0) { exit(0); - } else if (strcmp(command, "who\n") == 0) { + } else if (strcmp(command, "who\n") == 0 || strcmp(command, "w\n") == 0) { // print a list of online peers pthread_mutex_lock(&peer_table_lock); @@ -74,7 +73,7 @@ void process_user_command() { pthread_mutex_unlock(&peer_table_lock); - } else if (strcmp(command, "chat\n") == 0) { + } else if (strcmp(command, "chat\n") == 0 || strcmp(command, "c\n") == 0) { char user[32]; int exists; @@ -99,6 +98,7 @@ void process_user_command() { printf("Command Summary: \n"); printf(" who: display a list of online peers \n"); printf(" chat: initiate a chat session \n"); + printf(" quit: exit the localchat program \n"); } else if (strcmp(command, "\n") == 0) { // no command, do nothing. |