diff options
author | James Booth <boothj5@gmail.com> | 2014-01-23 23:53:20 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-01-23 23:53:20 +0000 |
commit | 5d85974bc0d56cdcd3c1a84040a26bdcc7f17325 (patch) | |
tree | 6a84e103082dd294edf75b40739b705db982dbd0 /src/command/commands.c | |
parent | 66631308a5f09645fa8975a19615b6c1127031a4 (diff) | |
download | profani-tty-5d85974bc0d56cdcd3c1a84040a26bdcc7f17325.tar.gz |
Added aliases to autocomplete
Diffstat (limited to 'src/command/commands.c')
-rw-r--r-- | src/command/commands.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index 5d30d183..cd82f9f6 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -27,6 +27,7 @@ #include "chat_session.h" #include "command/commands.h" +#include "command/command.h" #include "common.h" #include "config/accounts.h" #include "config/account.h" @@ -1835,6 +1836,10 @@ cmd_alias(gchar **args, struct cmd_help_t help) return TRUE; } else { if (prefs_add_alias(alias, value) == TRUE) { + GString *ac_value = g_string_new("/"); + g_string_append(ac_value, alias); + cmd_autocomplete_add(ac_value->str); + g_string_free(ac_value, TRUE); cons_show("Command alias added /%s -> %s", alias, value); } else { cons_show("Command alias /%s already exists.", alias); @@ -1852,6 +1857,10 @@ cmd_alias(gchar **args, struct cmd_help_t help) if (!removed) { cons_show("No such command alias /%s", alias); } else { + GString *ac_value = g_string_new("/"); + g_string_append(ac_value, alias); + cmd_autocomplete_remove(ac_value->str); + g_string_free(ac_value, TRUE); cons_show("Command alias removed -> /%s", alias); } return TRUE; |