about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorWill Song <incertia9474@gmail.com>2015-05-29 20:49:28 -0500
committerWill Song <incertia9474@gmail.com>2015-05-29 20:49:28 -0500
commit0e7507a1aa3390fe1899e3b4d705c823ff4011f8 (patch)
treead108f3b4128e78d0b94fe5eebdcfa96bac4fe56 /src
parent3842daa334095fcd4e8a851ca143b8a72a9094fc (diff)
downloadprofani-tty-0e7507a1aa3390fe1899e3b4d705c823ff4011f8.tar.gz
update autocomplete
Diffstat (limited to 'src')
-rw-r--r--src/command/command.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/command/command.c b/src/command/command.c
index 1871ea6c..3fa467d4 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -1201,7 +1201,7 @@ static Autocomplete occupants_ac;
 static Autocomplete occupants_default_ac;
 static Autocomplete occupants_show_ac;
 static Autocomplete time_ac;
-static Autocomplete time_statusbar_ac;
+static Autocomplete time_format_ac;
 static Autocomplete resource_ac;
 static Autocomplete inpblock_ac;
 static Autocomplete receipts_ac;
@@ -1546,15 +1546,12 @@ cmd_init(void)
     autocomplete_add(occupants_show_ac, "jid");
 
     time_ac = autocomplete_new();
-    autocomplete_add(time_ac, "minutes");
-    autocomplete_add(time_ac, "seconds");
-    autocomplete_add(time_ac, "off");
+    autocomplete_add(time_ac, "main");
     autocomplete_add(time_ac, "statusbar");
 
-    time_statusbar_ac = autocomplete_new();
-    autocomplete_add(time_statusbar_ac, "minutes");
-    autocomplete_add(time_statusbar_ac, "seconds");
-    autocomplete_add(time_statusbar_ac, "off");
+    time_format_ac = autocomplete_new();
+    autocomplete_add(time_format_ac, "set");
+    autocomplete_add(time_format_ac, "off");
 
     resource_ac = autocomplete_new();
     autocomplete_add(resource_ac, "set");
@@ -1624,7 +1621,7 @@ cmd_uninit(void)
     autocomplete_free(occupants_default_ac);
     autocomplete_free(occupants_show_ac);
     autocomplete_free(time_ac);
-    autocomplete_free(time_statusbar_ac);
+    autocomplete_free(time_format_ac);
     autocomplete_free(resource_ac);
     autocomplete_free(inpblock_ac);
     autocomplete_free(receipts_ac);
@@ -1796,7 +1793,7 @@ cmd_reset_autocomplete()
     autocomplete_reset(occupants_default_ac);
     autocomplete_reset(occupants_show_ac);
     autocomplete_reset(time_ac);
-    autocomplete_reset(time_statusbar_ac);
+    autocomplete_reset(time_format_ac);
     autocomplete_reset(resource_ac);
     autocomplete_reset(inpblock_ac);
     autocomplete_reset(receipts_ac);
@@ -2682,7 +2679,12 @@ _time_autocomplete(const char * const input)
 {
     char *found = NULL;
 
-    found = autocomplete_param_with_ac(input, "/time statusbar", time_statusbar_ac, TRUE);
+    found = autocomplete_param_with_ac(input, "/time statusbar", time_format_ac, TRUE);
+    if (found) {
+        return found;
+    }
+
+    found = autocomplete_param_with_ac(input, "/time main", time_format_ac, TRUE);
     if (found) {
         return found;
     }