From aee2d059df1dd742826582d6b144ddbb7ede7198 Mon Sep 17 00:00:00 2001 From: clpr Date: Thu, 1 Aug 2013 12:03:01 +0100 Subject: Use print_usage for help command --- testing/toxic/prompt.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'testing/toxic/prompt.c') diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c index e18bdff0..3c4a27dd 100644 --- a/testing/toxic/prompt.c +++ b/testing/toxic/prompt.c @@ -16,6 +16,7 @@ uint8_t pending_requests[256][CLIENT_ID_SIZE]; // XXX uint8_t num_requests=0; // XXX extern void on_friendadded(int friendnumber); +static void print_usage(ToxWindow* self); // XXX: int add_req(uint8_t* public_key) { @@ -138,24 +139,7 @@ static void execute(ToxWindow* self, char* cmd) { on_friendadded(num); } else if(!strcmp(cmd, "help")) { - wattron(self->window, COLOR_PAIR(2) | A_BOLD); - wprintw(self->window, "Commands:\n"); - wattroff(self->window, A_BOLD); - - wprintw(self->window, " connect : Connect to DHT server\n"); - wprintw(self->window, " add : Add friend\n"); - wprintw(self->window, " status : Set your status\n"); - wprintw(self->window, " nick : Set your nickname\n"); - wprintw(self->window, " accept : Accept friend request\n"); - wprintw(self->window, " myid : Print your ID\n"); - wprintw(self->window, " quit/exit : Exit program\n"); - - - wattron(self->window, A_BOLD); - wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n"); - wattroff(self->window, A_BOLD); - - wattroff(self->window, COLOR_PAIR(2)); + print_usage(self); } else if(!strncmp(cmd, "status ", strlen("status "))) { char* msg; -- cgit v1.2.3