about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-01-23 23:53:20 +0000
committerJames Booth <boothj5@gmail.com>2014-01-23 23:53:20 +0000
commit5d85974bc0d56cdcd3c1a84040a26bdcc7f17325 (patch)
tree6a84e103082dd294edf75b40739b705db982dbd0 /src/command/commands.c
parent66631308a5f09645fa8975a19615b6c1127031a4 (diff)
downloadprofani-tty-5d85974bc0d56cdcd3c1a84040a26bdcc7f17325.tar.gz
Added aliases to autocomplete
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c9
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;