diff options
author | Ben Burwell <bburwell1@gmail.com> | 2013-05-02 09:31:41 -0400 |
---|---|---|
committer | Ben Burwell <bburwell1@gmail.com> | 2013-05-02 09:31:41 -0400 |
commit | 8c90613ed8765eb25a9973309c66d85767ceb838 (patch) | |
tree | f9d6d76a577495c0a872f512a1ea45064e67e7a0 /user_command.h | |
parent | 627c3a7cb176ffe4ffee5b9f92a9af7bb60f490a (diff) |
Diffstat (limited to 'user_command.h')
-rw-r--r-- | user_command.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/user_command.h b/user_command.h index 9e0df5a..3fcd40c 100644 --- a/user_command.h +++ b/user_command.h @@ -111,12 +111,24 @@ void process_user_command() { } + } else if (strcmp(command, "ip\n") == 0) { + + char user[32]; + + printf("user: "); + fgets(user, 32, stdin); + + user[strlen(user) - 1] = 0; + + get_ip_by_username(user); + } else if (strcmp(command, "help\n") == 0 || strcmp(command, "?\n") == 0) { 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"); + printf(" ip: display the IP address of a user \n"); } else if (strcmp(command, "\n") == 0) { // no command, do nothing. |