diff --git a/include/chat/flags.h b/include/chat/flags.h index c0b4fec..266b704 100644 --- a/include/chat/flags.h +++ b/include/chat/flags.h @@ -42,6 +42,7 @@ extern "C" { //COMMANDS #define WHY2_CHAT_COMMAND_PREFIX "!" //the little thingy you write before the command names to make the program recognise them boy. You know? Like in minecraft you use /kill... Also, are you dumb? #define WHY2_CHAT_COMMAND_EXIT "exit" //QUIT THE PROGRAM CMD +#define WHY2_CHAT_COMMAND_HELP "help" //PRINT ALL COMMANDS //SHORTCUTS CAUSE I'M LAZY BITCH #define WHY2_CHAT_CODE_SSQC WHY2_CHAT_CODE_SERVER_SIDE_QUIT_COMMUNICATION diff --git a/src/chat/main/client.c b/src/chat/main/client.c index 8e39d4b..cbbb3b1 100644 --- a/src/chat/main/client.c +++ b/src/chat/main/client.c @@ -116,6 +116,17 @@ int main(void) why2_send_socket(exit_cmd, NULL, listen_socket); why2_deallocate(exit_cmd); + } else if (strcmp(line, WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_HELP "\n") == 0) + { + printf + ( + "\nCommands:\n---------\n%s\n\n>>> ", + + WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_EXIT "\tExits the program.\n" + WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_HELP "\tPrints out all the commands. :)" + ); + + fflush(stdout); } else { why2_send_socket(line, NULL, listen_socket); //NULL IS SENT BECAUSE IT IS USELESS TO SEND USER FROM CLIENT - SERVER WON'T USE IT diff --git a/src/chat/misc.c b/src/chat/misc.c index 6c5a9d5..a5daad2 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -830,7 +830,7 @@ void *why2_listen_server(void *socket) fflush(stdout); } else if (strcmp(message, WHY2_CHAT_CODE_INVALID_COMMAND) == 0) //INVALID CMD { - printf("\nInvalid command!\n\n"); + printf("\nInvalid command! Use \"" WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_HELP "\" for list of commands.\n\n"); fflush(stdout); } } else if (!continuing)