From 8ecbe0c590832200134e54fe55da872917278f64 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 13 Nov 2012 22:24:37 +0000 Subject: Fixed help command name clash on status --- src/command.c | 38 +++++++++++++++++++------------------- src/command.h | 2 +- src/ui.h | 2 +- src/windows.c | 14 +++++++------- 4 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/command.c b/src/command.c index 24637798..c2668bef 100644 --- a/src/command.c +++ b/src/command.c @@ -125,7 +125,7 @@ static struct cmd_t main_commands[] = "-------------------------", "Show help options.", "Specify list if you want a list of all commands.", - "Specify an area (basic, status, settings, navigation) for more help on that area.", + "Specify an area (basic, presence, settings, navigation) for more help on that area.", "Specify the command if you want more detailed help on a specific command.", "", "Example : /help list", @@ -193,9 +193,9 @@ static struct cmd_t main_commands[] = { "/status", _cmd_status, - { "/msg user@host", "Find out a contacts status.", - { "/msg user@host", - "--------------", + { "/status user@host", "Find out a contacts status.", + { "/status user@host", + "-----------------", "Find out someones presence information.", "Use tab completion to autocomplete the contact.", NULL } } }, @@ -436,7 +436,7 @@ static struct cmd_t setting_commands[] = NULL } } } }; -static struct cmd_t status_commands[] = +static struct cmd_t presence_commands[] = { { "/away", _cmd_away, @@ -518,7 +518,7 @@ cmd_init(void) help_ac = p_autocomplete_new(); p_autocomplete_add(help_ac, strdup("list")); p_autocomplete_add(help_ac, strdup("basic")); - p_autocomplete_add(help_ac, strdup("status")); + p_autocomplete_add(help_ac, strdup("presence")); p_autocomplete_add(help_ac, strdup("settings")); p_autocomplete_add(help_ac, strdup("navigation")); @@ -549,8 +549,8 @@ cmd_init(void) p_autocomplete_add(help_ac, (gchar *)strdup(pcmd->cmd+1)); } - for (i = 0; i < ARRAY_SIZE(status_commands); i++) { - struct cmd_t *pcmd = status_commands+i; + for (i = 0; i < ARRAY_SIZE(presence_commands); i++) { + struct cmd_t *pcmd = presence_commands+i; p_autocomplete_add(commands_ac, (gchar *)strdup(pcmd->cmd)); p_autocomplete_add(help_ac, (gchar *)strdup(pcmd->cmd+1)); p_autocomplete_add(who_ac, (gchar *)strdup(pcmd->cmd+1)); @@ -640,13 +640,13 @@ cmd_get_settings_help(void) } GSList * -cmd_get_status_help(void) +cmd_get_presence_help(void) { GSList *result = NULL; unsigned int i; - for (i = 0; i < ARRAY_SIZE(status_commands); i++) { - result = g_slist_append(result, &((status_commands+i)->help)); + for (i = 0; i < ARRAY_SIZE(presence_commands); i++) { + result = g_slist_append(result, &((presence_commands+i)->help)); } return result; @@ -951,19 +951,19 @@ _cmd_help(const char * const inp, struct cmd_help_t help) } } cons_show_word("\n"); - cons_show("Status commands:"); + cons_show("Presence commands:"); cons_show_time(); - for (i = 0; i < ARRAY_SIZE(status_commands); i++) { - cons_show_word( (status_commands+i)->cmd ); - if (i < ARRAY_SIZE(status_commands) - 1) { + for (i = 0; i < ARRAY_SIZE(presence_commands); i++) { + cons_show_word( (presence_commands+i)->cmd ); + if (i < ARRAY_SIZE(presence_commands) - 1) { cons_show_word(", "); } } cons_show_word("\n"); } else if (strcmp(inp, "/help basic") == 0) { cons_basic_help(); - } else if (strcmp(inp, "/help status") == 0) { - cons_status_help(); + } else if (strcmp(inp, "/help presence") == 0) { + cons_presence_help(); } else if (strcmp(inp, "/help settings") == 0) { cons_settings_help(); } else if (strcmp(inp, "/help navigation") == 0) { @@ -1614,8 +1614,8 @@ _cmd_get_command(const char * const command) } } - for (i = 0; i < ARRAY_SIZE(status_commands); i++) { - struct cmd_t *pcmd = status_commands+i; + for (i = 0; i < ARRAY_SIZE(presence_commands); i++) { + struct cmd_t *pcmd = presence_commands+i; if (strcmp(pcmd->cmd, command) == 0) { return pcmd; } diff --git a/src/command.h b/src/command.h index e53d1773..654a7a7c 100644 --- a/src/command.h +++ b/src/command.h @@ -43,6 +43,6 @@ gboolean cmd_execute_default(const char * const inp); GSList * cmd_get_basic_help(void); GSList * cmd_get_settings_help(void); -GSList * cmd_get_status_help(void); +GSList * cmd_get_presence_help(void); #endif diff --git a/src/ui.h b/src/ui.h index 3fd6faf7..0b171ea6 100644 --- a/src/ui.h +++ b/src/ui.h @@ -134,7 +134,7 @@ void cons_about(void); void cons_help(void); void cons_basic_help(void); void cons_settings_help(void); -void cons_status_help(void); +void cons_presence_help(void); void cons_navigation_help(void); void cons_prefs(void); void cons_bad_command(const char * const cmd); diff --git a/src/windows.c b/src/windows.c index fc21a622..fe14a358 100644 --- a/src/windows.c +++ b/src/windows.c @@ -943,7 +943,7 @@ cons_help(void) cons_show(""); cons_show("/help list - List all commands."); cons_show("/help basic - Summary of basic usgae commands."); - cons_show("/help status - Summary of online status change commands."); + cons_show("/help presence - Summary of online status change commands."); cons_show("/help settings - Summary of commands for changing Profanity settings."); cons_show("/help navigation - How to navigate around Profanity."); cons_show("/help [command] - Detailed help on a specific command."); @@ -985,17 +985,17 @@ cons_settings_help(void) } void -cons_status_help(void) +cons_presence_help(void) { cons_show(""); - cons_show("Status changes:"); + cons_show("Presence changes:"); cons_show(""); - GSList *status_helpers = cmd_get_status_help(); - while (status_helpers != NULL) { - struct cmd_help_t *help = (struct cmd_help_t *)status_helpers->data; + GSList *presence_helpers = cmd_get_presence_help(); + while (presence_helpers != NULL) { + struct cmd_help_t *help = (struct cmd_help_t *)presence_helpers->data; cons_show("%-25s: %s", help->usage, help->short_help); - status_helpers = g_slist_next(status_helpers); + presence_helpers = g_slist_next(presence_helpers); } cons_show(""); -- cgit 1.4.1-2-gfad0