diff options
-rw-r--r-- | src/command/command.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/command/command.c b/src/command/command.c index bea347e7..8b4a936d 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -1251,18 +1251,19 @@ cmd_execute(const char * const command, const char * const inp) if (cmd != NULL) { gchar **args = cmd->parser(inp, cmd->min_args, cmd->max_args, &result); - if ((result == FALSE) && (cmd->setting_func != NULL)) { - cons_show(""); - (*cmd->setting_func)(); - cons_show("Usage: %s", cmd->help.usage); - return TRUE; - } else if (result == FALSE) { - cons_show(""); - cons_show("Usage: %s", cmd->help.usage); - if (ui_current_win_type() == WIN_CHAT) { - char usage[strlen(cmd->help.usage) + 8]; - sprintf(usage, "Usage: %s", cmd->help.usage); - ui_current_print_line(usage); + if (result == FALSE) { + if (cmd->setting_func != NULL) { + cons_show(""); + (*cmd->setting_func)(); + cons_show("Usage: %s", cmd->help.usage); + } else { + cons_show(""); + cons_show("Usage: %s", cmd->help.usage); + if (ui_current_win_type() == WIN_CHAT) { + char usage[strlen(cmd->help.usage) + 8]; + sprintf(usage, "Usage: %s", cmd->help.usage); + ui_current_print_line(usage); + } } return TRUE; } else { |