diff options
author | irungentoo <irungentoo@gmail.com> | 2013-07-31 17:29:35 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-07-31 17:29:35 -0700 |
commit | c3b5fe3fa154e60d46d647f7928cab48ec4012a0 (patch) | |
tree | a6192d347ceebadfdf2204e659d3c3e328517911 /testing/toxic/prompt.c | |
parent | b5b28e43f894a425ddaaa35471f3ac39308d341f (diff) | |
parent | 1e1c731470752ae60d1f7ad6b484e36c3816f484 (diff) |
Merge pull request #227 from Proplex/master
Add help command to Toxic
Diffstat (limited to 'testing/toxic/prompt.c')
-rw-r--r-- | testing/toxic/prompt.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c index b09b3d8d..e18bdff0 100644 --- a/testing/toxic/prompt.c +++ b/testing/toxic/prompt.c | |||
@@ -137,6 +137,26 @@ static void execute(ToxWindow* self, char* cmd) { | |||
137 | wprintw(self->window, "Friend added as %d.\n", num); | 137 | wprintw(self->window, "Friend added as %d.\n", num); |
138 | on_friendadded(num); | 138 | on_friendadded(num); |
139 | } | 139 | } |
140 | else if(!strcmp(cmd, "help")) { | ||
141 | wattron(self->window, COLOR_PAIR(2) | A_BOLD); | ||
142 | wprintw(self->window, "Commands:\n"); | ||
143 | wattroff(self->window, A_BOLD); | ||
144 | |||
145 | wprintw(self->window, " connect <ip> <port> <key> : Connect to DHT server\n"); | ||
146 | wprintw(self->window, " add <id> <message> : Add friend\n"); | ||
147 | wprintw(self->window, " status <message> : Set your status\n"); | ||
148 | wprintw(self->window, " nick <nickname> : Set your nickname\n"); | ||
149 | wprintw(self->window, " accept <number> : Accept friend request\n"); | ||
150 | wprintw(self->window, " myid : Print your ID\n"); | ||
151 | wprintw(self->window, " quit/exit : Exit program\n"); | ||
152 | |||
153 | |||
154 | wattron(self->window, A_BOLD); | ||
155 | wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n"); | ||
156 | wattroff(self->window, A_BOLD); | ||
157 | |||
158 | wattroff(self->window, COLOR_PAIR(2)); | ||
159 | } | ||
140 | else if(!strncmp(cmd, "status ", strlen("status "))) { | 160 | else if(!strncmp(cmd, "status ", strlen("status "))) { |
141 | char* msg; | 161 | char* msg; |
142 | 162 | ||
@@ -292,6 +312,7 @@ static void print_usage(ToxWindow* self) { | |||
292 | wprintw(self->window, " accept <number> : Accept friend request\n"); | 312 | wprintw(self->window, " accept <number> : Accept friend request\n"); |
293 | wprintw(self->window, " myid : Print your ID\n"); | 313 | wprintw(self->window, " myid : Print your ID\n"); |
294 | wprintw(self->window, " quit/exit : Exit program\n"); | 314 | wprintw(self->window, " quit/exit : Exit program\n"); |
315 | wprintw(self->window, " help : Print this message again\n"); | ||
295 | 316 | ||
296 | 317 | ||
297 | wattron(self->window, A_BOLD); | 318 | wattron(self->window, A_BOLD); |