about summary refs log tree commit diff stats
path: root/src/command/cmd_defs.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2018-09-27 17:27:37 +0200
committerGitHub <noreply@github.com>2018-09-27 17:27:37 +0200
commit47f90d7a39002ce4ee683179e25797a78cf95905 (patch)
treed3ab27090ef03ed6c88a414293eb97e8e54a03f0 /src/command/cmd_defs.c
parentbb87122af9f477f8f0b53240537aae20c105a88c (diff)
parent2e0bc27bf0d19f07fa60a48dfd8189edb4462f54 (diff)
downloadprofani-tty-47f90d7a39002ce4ee683179e25797a78cf95905.tar.gz
Merge pull request #991 from paulfariello/feature/xep-0050
Add support for xep 0050 ad-hoc commands, without multi-step
Diffstat (limited to 'src/command/cmd_defs.c')
-rw-r--r--src/command/cmd_defs.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index ee320e84..04a2fe35 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -1265,8 +1265,8 @@ static struct cmd_t command_defs[] =
         CMD_TAGS(
             CMD_TAG_UI)
         CMD_SYN(
-            "/time console|chat|muc|mucconfig|private|xml set <format>",
-            "/time console|chat|muc|mucconfig|private|xml off",
+            "/time console|chat|muc|config|private|xml set <format>",
+            "/time console|chat|muc|config|private|xml off",
             "/time statusbar set <format>",
             "/time statusbar off",
             "/time lastactivity set <format>")
@@ -1283,8 +1283,8 @@ static struct cmd_t command_defs[] =
             { "chat off",                  "Do not show time in chat windows." },
             { "muc set <format>",          "Set time format for chat room windows." },
             { "muc off",                   "Do not show time in chat room windows." },
-            { "mucconfig set <format>",    "Set time format for chat room config windows." },
-            { "mucconfig off",             "Do not show time in chat room config windows." },
+            { "config set <format>",       "Set time format for config windows." },
+            { "config off",                "Do not show time in config windows." },
             { "private set <format>",      "Set time format for private chat windows." },
             { "private off",               "Do not show time in private chat windows." },
             { "xml set <format>",          "Set time format for XML console window." },
@@ -2306,6 +2306,26 @@ static struct cmd_t command_defs[] =
         CMD_EXAMPLES(
             "/export /path/to/output.csv",
             "/export ~/contacts.csv")
+    },
+
+    { "/cmd",
+        parse_args, 1, 3, NULL,
+        CMD_SUBFUNCS(
+            { "list", cmd_command_list },
+            { "exec", cmd_command_exec })
+        CMD_NOMAINFUNC
+        CMD_NOTAGS
+        CMD_SYN(
+            "/cmd list [<jid>]",
+            "/cmd exec <command> [<jid>]")
+        CMD_DESC(
+            "Execute ad hoc commands.")
+        CMD_ARGS(
+            { "list",           "List supported ad hoc commands." },
+            { "exec <command>", "Execute a command." })
+        CMD_EXAMPLES(
+            "/cmd list",
+            "/cmd exec ping")
     }
 };