diff --git a/Makefile.am b/Makefile.am
index 4a0d9dea..72edcd2f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,29 +68,29 @@ unittest_sources = \
tests/unittests/log/stub_log.c \
tests/unittests/config/stub_accounts.c \
tests/unittests/helpers.c tests/unittests/helpers.h \
- tests/unittests/test_cmd_account.c tests/unittests/test_cmd_account.h \
+ tests/unittests/test_form.c tests/unittests/test_form.h \
+ tests/unittests/test_common.c tests/unittests/test_common.h \
+ tests/unittests/test_autocomplete.c tests/unittests/test_autocomplete.h \
+ tests/unittests/test_jid.c tests/unittests/test_jid.h \
+ tests/unittests/test_parser.c tests/unittests/test_parser.h \
+ tests/unittests/test_roster_list.c tests/unittests/test_roster_list.h \
+ tests/unittests/test_chat_session.c tests/unittests/test_chat_session.h \
+ tests/unittests/test_contact.c tests/unittests/test_contact.h \
+ tests/unittests/test_preferences.c tests/unittests/test_preferences.h \
+ tests/unittests/test_server_events.c tests/unittests/test_server_events.h \
+ tests/unittests/test_muc.c tests/unittests/test_muc.h \
+ tests/unittests/test_cmd_statuses.c tests/unittests/test_cmd_statuses.h \
tests/unittests/test_cmd_alias.c tests/unittests/test_cmd_alias.h \
- tests/unittests/test_cmd_bookmark.c tests/unittests/test_cmd_bookmark.h \
tests/unittests/test_cmd_connect.c tests/unittests/test_cmd_connect.h \
- tests/unittests/test_cmd_join.c tests/unittests/test_cmd_join.h \
+ tests/unittests/test_cmd_rooms.c tests/unittests/test_cmd_rooms.h \
+ tests/unittests/test_cmd_account.c tests/unittests/test_cmd_account.h \
+ tests/unittests/test_cmd_sub.c tests/unittests/test_cmd_sub.h \
+ tests/unittests/test_cmd_bookmark.c tests/unittests/test_cmd_bookmark.h \
tests/unittests/test_cmd_otr.c tests/unittests/test_cmd_otr.h \
tests/unittests/test_cmd_pgp.c tests/unittests/test_cmd_pgp.h \
- tests/unittests/test_cmd_rooms.c tests/unittests/test_cmd_rooms.h \
+ tests/unittests/test_cmd_join.c tests/unittests/test_cmd_join.h \
tests/unittests/test_cmd_roster.c tests/unittests/test_cmd_roster.h \
- tests/unittests/test_cmd_statuses.c tests/unittests/test_cmd_statuses.h \
- tests/unittests/test_cmd_sub.c tests/unittests/test_cmd_sub.h \
tests/unittests/test_cmd_disconnect.c tests/unittests/test_cmd_disconnect.h \
- tests/unittests/test_common.c tests/unittests/test_common.h \
- tests/unittests/test_contact.c tests/unittests/test_contact.h \
- tests/unittests/test_form.c tests/unittests/test_form.h \
- tests/unittests/test_jid.c tests/unittests/test_jid.h \
- tests/unittests/test_muc.c tests/unittests/test_muc.h \
- tests/unittests/test_parser.c tests/unittests/test_parser.h \
- tests/unittests/test_preferences.c tests/unittests/test_preferences.h \
- tests/unittests/test_roster_list.c tests/unittests/test_roster_list.h \
- tests/unittests/test_server_events.c tests/unittests/test_server_events.h \
- tests/unittests/test_autocomplete.c tests/unittests/test_autocomplete.h \
- tests/unittests/test_chat_session.c tests/unittests/test_chat_session.h \
tests/unittests/unittests.c
functionaltest_sources = \
diff --git a/src/command/command.c b/src/command/command.c
index 9d33f61b..182dcc70 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -101,1091 +101,1516 @@ static char * _titlebar_autocomplete(ProfWin *window, const char * const input);
static char * _inpblock_autocomplete(ProfWin *window, const char * const input);
static char * _time_autocomplete(ProfWin *window, const char * const input);
static char * _receipts_autocomplete(ProfWin *window, const char * const input);
+static char * _help_autocomplete(ProfWin *window, const char * const input);
GHashTable *commands = NULL;
+#define CMD_TAG_CHAT "chat"
+#define CMD_TAG_GROUPCHAT "groupchat"
+#define CMD_TAG_ROSTER "roster"
+#define CMD_TAG_PRESENCE "presence"
+#define CMD_TAG_CONNECTION "connection"
+#define CMD_TAG_DISCOVERY "discovery"
+#define CMD_TAG_UI "ui"
+
+#define CMD_NOTAGS { { NULL },
+#define CMD_TAGS(...) { { __VA_ARGS__, NULL },
+#define CMD_SYN(...) { __VA_ARGS__, NULL },
+#define CMD_DESC(desc) desc,
+#define CMD_NOARGS { { NULL, NULL } },
+#define CMD_ARGS(...) { __VA_ARGS__, { NULL, NULL } },
+#define CMD_NOEXAMPLES { NULL } }
+#define CMD_EXAMPLES(...) { __VA_ARGS__, NULL } }
+
/*
* Command list
*/
static struct cmd_t command_defs[] =
{
{ "/help",
- cmd_help, parse_args, 0, 1, NULL,
- { "/help [area|command]", "Help on using Profanity.",
- { "/help [area|command]",
- "--------------------",
- "Help on using Profanity.",
- "",
- "area : Summary help for commands in a certain area of functionality.",
- "command : Full help for a specific command, for example '/help connect'.",
- "",
- "Use with no arguments to see a list of areas.",
- "",
- "Example: /help commands",
- "Example: /help presence",
- "Example: /help who",
- NULL } } },
+ cmd_help, parse_args, 0, 2, NULL,
+ CMD_NOTAGS
+ CMD_SYN(
+ "/help [|]")
+ CMD_DESC(
+ "Help on using Profanity. Passing no arguments list help areas.")
+ CMD_ARGS(
+ { "", "Summary help for commands in a certain area of functionality." },
+ { "", "Full help for a specific command, for example '/help connect'." })
+ CMD_EXAMPLES(
+ "/help commands",
+ "/help presence",
+ "/help who")
+ },
{ "/about",
cmd_about, parse_args, 0, 0, NULL,
- { "/about", "About Profanity.",
- { "/about",
- "------",
- "Show version and license information.",
- NULL } } },
+ CMD_NOTAGS
+ CMD_SYN(
+ "/about")
+ CMD_DESC(
+ "Show version and license information.")
+ CMD_NOARGS
+ CMD_NOEXAMPLES
+ },
{ "/connect",
cmd_connect, parse_args, 0, 5, NULL,
- { "/connect [account] [server value] [port value]", "Account login.",
- { "/connect [account] [server value] [port value]",
- "----------------------------------------------",
- "Login to a chat service.",
- "",
- "account : The local account you wish to connect with, or a JID if connecting for the first time.",
- "server value : Supply a server if it is different to the domain part of your JID.",
- "port value : The port to use if different to the default (5222, or 5223 for SSL).",
- "",
- "If no account is specified, the default is used if one is configured.",
- "A local account is created with the JID as it's name if it doesn't already exist.",
- "",
- "Example: /connect",
- "Example: /connect myuser@gmail.com",
- "Example: /connect myuser@mycompany.com server talk.google.com",
- "Example: /connect bob@someplace port 5678",
- "Example: /connect me@chatty server chatty.com port 5443",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_CONNECTION)
+ CMD_SYN(
+ "/connect []",
+ "/connect [server ] [port ]")
+ CMD_DESC(
+ "Login to a chat service. "
+ "If no account is specified, the default is used if one is configured. "
+ "A local account is created with the JID as it's name if it doesn't already exist.")
+ CMD_ARGS(
+ { "", "The local account you wish to connect with, or a JID if connecting for the first time." },
+ { "server ", "Supply a server if it is different to the domain part of your JID." },
+ { "port ", "The port to use if different to the default (5222, or 5223 for SSL)." })
+ CMD_EXAMPLES(
+ "/connect",
+ "/connect myuser@gmail.com",
+ "/connect myuser@mycompany.com server talk.google.com",
+ "/connect bob@someplace port 5678",
+ "/connect me@chatty server chatty.com port 5443")
+ },
{ "/disconnect",
cmd_disconnect, parse_args, 0, 0, NULL,
- { "/disconnect", "Logout of current session.",
- { "/disconnect",
- "-----------",
- "Disconnect from the current chat service.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_CONNECTION)
+ CMD_SYN(
+ "/disconnect")
+ CMD_DESC(
+ "Disconnect from the current chat service.")
+ CMD_NOARGS
+ CMD_NOEXAMPLES
+ },
{ "/msg",
cmd_msg, parse_args_with_freetext, 1, 2, NULL,
- { "/msg contact|nick [message]", "Start chat with a user.",
- { "/msg contact|nick [message]",
- "---------------------------",
- "Send a one to one chat message, or a private message to a chat room occupant.",
- "",
- "contact : The contact's JID, or nickname if one has been set in your roster.",
- "nick : A chat room occupant, to whom you wish to send a private message.",
- "message : The message to send",
- "",
- "If the message is omitted, a new chat window will be opened without sending a message.",
- "Use quotes if the nickname includes spaces.",
- "",
- "Example: /msg myfriend@server.com Hey, here's a message!",
- "Example: /msg otherfriend@server.com",
- "Example: /msg Bob Here is a private message",
- "Example: /msg \"My Friend\" Hi, how are you?",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_CHAT)
+ CMD_SYN(
+ "/msg []",
+ "/msg []")
+ CMD_DESC(
+ "Send a one to one chat message, or a private message to a chat room occupant. "
+ "If the message is omitted, a new chat window will be opened without sending a message. "
+ "Use quotes if the nickname includes spaces.")
+ CMD_ARGS(
+ { "", "Open chat window with contact, by JID or nickname." },
+ { " []", "Send message to contact, by JID or nickname." },
+ { "", "Open private chat window with chat room occupant." },
+ { " []", "Send a private message to a chat room occupant." })
+ CMD_EXAMPLES(
+ "/msg myfriend@server.com Hey, here's a message!",
+ "/msg otherfriend@server.com",
+ "/msg Bob Here is a private message",
+ "/msg \"My Friend\" Hi, how are you?")
+ },
{ "/roster",
cmd_roster, parse_args_with_freetext, 0, 3, NULL,
- { "/roster [command] [args..]", "Manage your roster.",
- { "/roster [command] [args..]",
- "--------------------------",
- "Manage your roster, and roster display settings.",
- "",
- "command - online|show|hide|by|size|add|remove|remove_all|nick|clearnick",
- "",
- "online : Show all online contacts in your roster.",
- "show : Show the roster panel.",
- "show offline : Show offline contacts in the roster panel.",
- "show resource : Show contact's connected resources in the roster panel.",
- "show empty : When grouping by presence, show empty presence groups",
- "hide : Hide the roster panel.",
- "hide offline : Hide offline contacts in the roster panel.",
- "hide resource : Hide contact's connected resources in the roster panel.",
- "hide empty : When grouping by presence, hide empty presence groups",
- "by group : Group contacts in the roster panel by roster group.",
- "by presence : Group contacts in the roster panel by presence.",
- "by none : No grouping in the roster panel.",
- "size : Percentage of the screen taken up by the roster (1-99).",
- "add jid [nick] : Add a new item to the roster.",
- "remove jid : Removes an item from the roster.",
- "remove_all contacts : Remove all items from roster.",
- "nick jid nick : Change a contacts nickname.",
- "clearnick jid : Removes the current nickname.",
- "",
- "Passing no arguments lists all contacts in your roster.",
- "",
- "Example: /roster (show your roster)",
- "Example: /roster add someone@contacts.org (add the contact)",
- "Example: /roster add someone@contacts.org Buddy (add the contact with nickname 'Buddy')",
- "Example: /roster remove someone@contacts.org (remove the contact)",
- "Example: /roster nick myfriend@chat.org My Friend",
- "Example: /roster clearnick kai@server.com (clears nickname)",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_ROSTER,
+ CMD_TAG_UI)
+ CMD_SYN(
+ "/roster",
+ "/roster online",
+ "/roster show [offline|resource|empty]",
+ "/roster hide [offline|resource|empty]",
+ "/roster by group|presence|none",
+ "/roster size ",
+ "/roster add []",
+ "/roster remove ",
+ "/roster remove_all contacts",
+ "/roster nick ",
+ "/roster clearnick ")
+ CMD_DESC(
+ "Manage your roster, and roster display settings. "
+ "Passing no arguments lists all contacts in your roster.")
+ CMD_ARGS(
+ { "online", "Show all online contacts in your roster." },
+ { "show", "Show the roster panel." },
+ { "show offline", "Show offline contacts in the roster panel." },
+ { "show resource", "Show contact's connected resources in the roster panel." },
+ { "show empty", "When grouping by presence, show empty presence groups." },
+ { "show empty", "When grouping by presence, show empty presence groups." },
+ { "hide", "Hide the roster panel." },
+ { "hide offline", "Hide offline contacts in the roster panel." },
+ { "hide resource", "Hide contact's connected resources in the roster panel." },
+ { "hide empty", "When grouping by presence, hide empty presence groups." },
+ { "by group", "Group contacts in the roster panel by roster group." },
+ { "by presence", "Group contacts in the roster panel by presence." },
+ { "by none", "No grouping in the roster panel." },
+ { "size ", "Percentage of the screen taken up by the roster (1-99)." },
+ { "add []", "Add a new item to the roster." },
+ { "remove ", "Removes an item from the roster." },
+ { "remove_all contacts", "Remove all items from roster." },
+ { "nick ", "Change a contacts nickname." },
+ { "clearnick ", "Removes the current nickname." })
+ CMD_EXAMPLES(
+ "/roster",
+ "/roster add someone@contacts.org",
+ "/roster add someone@contacts.org Buddy",
+ "/roster remove someone@contacts.org",
+ "/roster nick myfriend@chat.org My Friend",
+ "/roster clearnick kai@server.com",
+ "/roster size 15")
+ },
{ "/group",
cmd_group, parse_args_with_freetext, 0, 3, NULL,
- { "/group [show|add|remove] [group] [contact]", "Manage roster groups.",
- { "/group [show|add|remove] [group] [contact]",
- "------------------------------------------",
- "View, add to, and remove from roster groups.",
- "",
- "show group : List all roster items a group.",
- "add group contact : Added a contact to a group.",
- "remove group contact : Remove a contact from a group.",
- "",
- "Passing no argument will list all roster groups.",
- "",
- "Example: /group",
- "Example: /group show friends",
- "Example: /group add friends newfriend@server.org",
- "Example: /group add family Brother (using contacts nickname)",
- "Example: /group remove colleagues boss@work.com",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_ROSTER,
+ CMD_TAG_UI)
+ CMD_SYN(
+ "/group",
+ "/group show ",
+ "/group add "
+ "/group remove ")
+ CMD_DESC(
+ "View, add to, and remove from roster groups. "
+ "Passing no argument will list all roster groups.")
+ CMD_ARGS(
+ { "show ", "List all roster items a group." },
+ { "add ", "Add a contact to a group." },
+ { "remove ", "Remove a contact from a group." })
+ CMD_EXAMPLES(
+ "/group",
+ "/group show friends",
+ "/group add friends newfriend@server.org",
+ "/group add family Brother",
+ "/group remove colleagues boss@work.com")
+ },
{ "/info",
cmd_info, parse_args, 0, 1, NULL,
- { "/info [contact|nick]", "Show information about a contact, room, or room member.",
- { "/info [contact|nick]",
- "--------------------",
- "Show information about a contact, room, or room member.",
- "",
- "contact : The contact you wish to view information about.",
- "nick : When in a chat room, the occupant you wish to view information about.",
- "",
- "Passing no argument in a chat window will use the current recipient.",
- "Passing no argument in a chat room will display information about the room.",
- "",
- "Example: /info mybuddy@chat.server.org",
- "Example: /info kai",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_ROSTER,
+ CMD_TAG_CHAT,
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/info",
+ "/info |")
+ CMD_DESC(
+ "Show information about a contact, room, or room member. "
+ "Passing no argument in a chat window will use the current recipient. "
+ "Passing no argument in a chat room will display information about the room.")
+ CMD_ARGS(
+ { "", "The contact you wish to view information about." },
+ { "", "When in a chat room, the occupant you wish to view information about." })
+ CMD_EXAMPLES(
+ "/info mybuddy@chat.server.org",
+ "/info kai")
+ },
{ "/caps",
cmd_caps, parse_args, 0, 1, NULL,
- { "/caps [fulljid|nick]", "Find out a contacts client software capabilities.",
- { "/caps [fulljid|nick]",
- "--------------------",
- "Find out a contacts, or room members client software capabilities.",
- "",
- "fulljid : If in the console or a chat window, the full JID for which you wish to see capabilities.",
- "nick : If in a chat room, nickname for which you wish to see capabilities.",
- "",
- "If in private chat initiated from a chat room, no parameter is required.",
- "",
- "Example: /caps mybuddy@chat.server.org/laptop (contact's laptop resource)",
- "Example: /caps mybuddy@chat.server.org/phone (contact's phone resource)",
- "Example: /caps bruce (room member)",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_DISCOVERY,
+ CMD_TAG_CHAT,
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/caps",
+ "/caps |")
+ CMD_DESC(
+ "Find out a contacts, or room members client software capabilities. "
+ "If in private chat initiated from a chat room, no parameter is required.")
+ CMD_ARGS(
+ { "", "If in the console or a chat window, the full JID for which you wish to see capabilities." },
+ { "", "If in a chat room, nickname for which you wish to see capabilities." })
+ CMD_EXAMPLES(
+ "/caps mybuddy@chat.server.org/laptop",
+ "/caps mybuddy@chat.server.org/phone",
+ "/caps bruce")
+ },
{ "/software",
cmd_software, parse_args, 0, 1, NULL,
- { "/software [fulljid|nick]", "Find out software version information about a contacts resource.",
- { "/software [fulljid|nick]",
- "------------------------",
- "Find out a contact, or room members software version information.",
- "",
- "fulljid : If in the console or a chat window, the full JID for which you wish to see software information.",
- "nick : If in a chat room, nickname for which you wish to see software information.",
- "",
- "If in private chat initiated from a chat room, no parameter is required.",
- "If the contact's software does not support software version requests, nothing will be displayed.",
- "",
- "Example: /software mybuddy@chat.server.org/laptop (contact's laptop resource)",
- "Example: /software mybuddy@chat.server.org/phone (contact's phone resource)",
- "Example: /software bruce (room member)",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_DISCOVERY,
+ CMD_TAG_CHAT,
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/software",
+ "/software |")
+ CMD_DESC(
+ "Find out a contact, or room members software version information. "
+ "If in private chat initiated from a chat room, no parameter is required. "
+ "If the contact's software does not support software version requests, nothing will be displayed.")
+ CMD_ARGS(
+ { "", "If in the console or a chat window, the full JID for which you wish to see software information." },
+ { "", "If in a chat room, nickname for which you wish to see software information." })
+ CMD_EXAMPLES(
+ "/software mybuddy@chat.server.org/laptop",
+ "/software mybuddy@chat.server.org/phone",
+ "/software bruce")
+ },
{ "/status",
cmd_status, parse_args, 0, 1, NULL,
- { "/status [contact|nick]", "Find out a contacts presence information.",
- { "/status [contact|nick]",
- "----------------------",
- "Find out a contact, or room members presence information.",
- "",
- "contact : The contact who's presence you which to see.",
- "nick : If in a chat room, the occupant who's presence you wish to see.",
- "",
- "If in a chat window the parameter is not required, the current recipient will be used.",
- "",
- "Example: /status buddy@server.com",
- "Example: /status jon",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_CHAT,
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/status",
+ "/status |")
+ CMD_DESC(
+ "Find out a contact, or room members presence information. "
+ "If in a chat window the parameter is not required, the current recipient will be used.")
+ CMD_ARGS(
+ { "", "The contact who's presence you which to see." },
+ { "", "If in a chat room, the occupant who's presence you wish to see." })
+ CMD_EXAMPLES(
+ "/status buddy@server.com",
+ "/status jon")
+ },
{ "/resource",
cmd_resource, parse_args, 1, 2, &cons_resource_setting,
- { "/resource set|off|title|message [resource]", "Set the contact's resource, display settings.",
- { "/resource set|off|title|message [resource]",
- "------------------------------------------",
- "Override chat session resource, and manage resource display settings.",
- "",
- "set resource : Set the resource to which messages will be sent.",
- "off : Let the server choose which resource to route messages to.",
- "title on|off : Show or hide the current resource in the titlebar.",
- "message on|off : Show or hide the resource when showing an incoming message.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_CHAT,
+ CMD_TAG_UI)
+ CMD_SYN(
+ "/resource set ",
+ "/resource off",
+ "/resource title on|off",
+ "/resource message on|off")
+ CMD_DESC(
+ "Override chat session resource, and manage resource display settings.")
+ CMD_ARGS(
+ { "set ", "Set the resource to which messages will be sent." },
+ { "off", "Let the server choose which resource to route messages to." },
+ { "title on|off", "Show or hide the current resource in the titlebar." },
+ { "message on|off", "Show or hide the resource when showing an incoming message." })
+ CMD_NOEXAMPLES
+ },
{ "/join",
cmd_join, parse_args, 0, 5, NULL,
- { "/join [room] [nick value] [password value]", "Join a chat room.",
- { "/join [room] [nick value] [password value]",
- "-----------------------------------------",
- "Join a chat room at the conference server.",
- "",
- "room : Bare room JID (the chat server is determined by the 'muc.service' account property) or full room jid."
- "nick value : Nickname to use in the room",
- "password value : Password if the room requires it.",
- "",
- "If no room is supplied, a generated name will be used with the format private-chat-[UUID].",
- "If no nickname is specified the account preference 'muc.nick' will be used which by default is the localpart of your JID.",
- "If the room doesn't exist, and the server allows it, a new one will be created.",
- "",
- "Example: /join",
- "Example: /join jdev@conference.jabber.org",
- "Example: /join jdev@conference.jabber.org nick mynick",
- "Example: /join private@conference.jabber.org nick mynick password mypassword",
- "Example: /join jdev (as user@jabber.org will join jdev@conference.jabber.org)",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/join",
+ "/join [nick ] [password ]")
+ CMD_DESC(
+ "Join a chat room at the conference server. "
+ "If no room is supplied, a generated name will be used with the format private-chat-[UUID]. "
+ "If the domain part is not included in the room name, the account preference 'muc.service' will be used. "
+ "If no nickname is specified the account preference 'muc.nick' will be used which by default is the localpart of your JID. "
+ "If the room doesn't exist, and the server allows it, a new one will be created.")
+ CMD_ARGS(
+ { "", "The chat room to join." },
+ { "nick ", "Nickname to use in the room." },
+ { "password ", "Password if the room requires one." })
+ CMD_EXAMPLES(
+ "/join",
+ "/join jdev@conference.jabber.org",
+ "/join jdev@conference.jabber.org nick mynick",
+ "/join private@conference.jabber.org nick mynick password mypassword",
+ "/join jdev")
+ },
{ "/leave",
cmd_leave, parse_args, 0, 0, NULL,
- { "/leave", "Leave a chat room.",
- { "/leave",
- "------",
- "Leave the current chat room.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/leave")
+ CMD_DESC(
+ "Leave the current chat room.")
+ CMD_NOARGS
+ CMD_NOEXAMPLES
+ },
{ "/invite",
cmd_invite, parse_args_with_freetext, 1, 2, NULL,
- { "/invite contact [message]", "Invite contact to chat room.",
- { "/invite contact [message]",
- "-------------------------",
- "Send a direct invite to the current chat room.",
- "",
- "contact : The contact you wish to invite",
- "message : An optional message to send with the invite.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/invite []")
+ CMD_DESC(
+ "Send an invite to a contact for the current chat room.")
+ CMD_ARGS(
+ { "", "The contact you wish to invite." },
+ { "", "An optional message to send with the invite." })
+ CMD_NOEXAMPLES
+ },
{ "/invites",
cmd_invites, parse_args_with_freetext, 0, 0, NULL,
- { "/invites", "Show outstanding chat room invites.",
- { "/invites",
- "--------",
- "Show all rooms that you have been invited to, and not accepted or declined.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/invites")
+ CMD_DESC(
+ "Show all rooms that you have been invited to, and not accepted or declined.")
+ CMD_NOARGS
+ CMD_NOEXAMPLES
+ },
{ "/decline",
cmd_decline, parse_args_with_freetext, 1, 1, NULL,
- { "/decline room", "Decline a chat room invite.",
- { "/decline room",
- "-------------",
- "Decline a chat room invitation.",
- "",
- "room : The room for the invite you wish to decline.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/decline ")
+ CMD_DESC(
+ "Decline a chat room invitation.")
+ CMD_ARGS(
+ { "", "The room for the invite you wish to decline." })
+ CMD_NOEXAMPLES
+ },
{ "/room",
cmd_room, parse_args, 1, 1, NULL,
- { "/room accept|destroy|config", "Room configuration.",
- { "/room accept|destroy|config",
- "---------------------------",
- "Chat room configuration.",
- "",
- "accept : Accept default room configuration.",
- "destroy : Reject default room configuration.",
- "config : Edit room configuration.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/room accept|destroy|config")
+ CMD_DESC(
+ "Chat room configuration.")
+ CMD_ARGS(
+ { "accept", "Accept default room configuration." },
+ { "destroy", "Reject default room configuration, and destroy the room." },
+ { "config", "Edit room configuration." })
+ CMD_NOEXAMPLES
+ },
{ "/kick",
cmd_kick, parse_args_with_freetext, 1, 2, NULL,
- { "/kick nick [reason]", "Kick occupants from chat rooms.",
- { "/kick nick [reason]",
- "-------------------",
- "Kick occupants from chat rooms.",
- "",
- "nick : Nickname of the occupant to kick from the room.",
- "reason : Optional reason for kicking the occupant.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/kick []")
+ CMD_DESC(
+ "Kick occupant from chat room.")
+ CMD_ARGS(
+ { "", "Nickname of the occupant to kick from the room." },
+ { "", "Optional reason for kicking the occupant." })
+ CMD_NOEXAMPLES
+ },
{ "/ban",
cmd_ban, parse_args_with_freetext, 1, 2, NULL,
- { "/ban jid [reason]", "Ban users from chat rooms.",
- { "/ban jid [reason]",
- "-----------------",
- "Ban users from chat rooms.",
- "",
- "jid : Bare JID of the user to ban from the room.",
- "reason : Optional reason for banning the user.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/ban []")
+ CMD_DESC(
+ "Ban user from chat room.")
+ CMD_ARGS(
+ { "", "Bare JID of the user to ban from the room." },
+ { "", "Optional reason for banning the user." })
+ CMD_NOEXAMPLES
+ },
{ "/subject",
cmd_subject, parse_args_with_freetext, 0, 2, NULL,
- { "/subject set|clear [subject]", "Set or clear room subject.",
- { "/subject set|clear [subject]",
- "----------------------------",
- "Set or clear room subject.",
- "",
- "set subject : Set the room subject.",
- "clear : Clear the room subject.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/subject set ",
+ "/subject clear")
+ CMD_DESC(
+ "Set or clear room subject.")
+ CMD_ARGS(
+ { "set ", "Set the room subject." },
+ { "clear", "Clear the room subject." })
+ CMD_NOEXAMPLES
+ },
{ "/affiliation",
cmd_affiliation, parse_args_with_freetext, 1, 4, NULL,
- { "/affiliation set|list [affiliation] [jid] [reason]", "Manage room affiliations.",
- { "/affiliation set|list [affiliation] [jid] [reason]",
- "--------------------------------------------------",
- "Manage room affiliations.",
- "",
- "set affiliation jid [reason]: Set the affiliation of user with jid, with an optional reason.",
- "list [affiliation] : List all users with the specified affiliation, or all if none specified.",
- "",
- "The affiliation may be one of owner, admin, member, outcast or none.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/affiliation set []",
+ "/list []")
+ CMD_DESC(
+ "Manage room affiliations. "
+ "Affiliation may be one of owner, admin, member, outcast or none.")
+ CMD_ARGS(
+ { "set []", "Set the affiliation of user with jid, with an optional reason." },
+ { "list []", "List all users with the specified affiliation, or all if none specified." })
+ CMD_NOEXAMPLES
+ },
{ "/role",
cmd_role, parse_args_with_freetext, 1, 4, NULL,
- { "/role set|list [role] [nick] [reason]", "Manage room roles.",
- { "/role set|list [role] [nick] [reason]",
- "-------------------------------------",
- "Manage room roles.",
- "",
- "set role nick [reason] : Set the role of occupant with nick, with an optional reason.",
- "list [role] : List all occupants with the specified role, or all if none specified.",
- "",
- "The role may be one of moderator, participant, visitor or none.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/role set []",
+ "/list []")
+ CMD_DESC(
+ "Manage room roles. "
+ "Role may be one of moderator, participant, visitor or none.")
+ CMD_ARGS(
+ { "set []", "Set the role of occupant with nick, with an optional reason." },
+ { "list []", "List all occupants with the specified role, or all if none specified." })
+ CMD_NOEXAMPLES
+ },
{ "/occupants",
cmd_occupants, parse_args, 1, 3, cons_occupants_setting,
- { "/occupants show|hide|default|size [jid|show|hide|percent] [jid]", "Show or hide room occupants.",
- { "/occupants show|hide|default|size [jid|show|hide|percent] [jid]",
- "---------------------------------------------------------------",
- "Show or hide room occupants, and occupants panel display settings.",
- "",
- "show : Show the occupants panel in current room.",
- "hide : Hide the occupants panel in current room.",
- "show jid : Show jid in the occupants panel in current room.",
- "hide jid : Hide jid in the occupants panel in current room.",
- "default show|hide : Whether occupants are shown by default in new rooms.",
- "default show|hide jid : Whether occupants jids are shown by default in new rooms.",
- "size percent : Percentage of the screen taken by the occupants list in rooms (1-99).",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT,
+ CMD_TAG_UI)
+ CMD_SYN(
+ "/occupants show|hide [jid]",
+ "/occupants default show|hide [jid]",
+ "/occupants size []")
+ CMD_DESC(
+ "Show or hide room occupants, and occupants panel display settings.")
+ CMD_ARGS(
+ { "show", "Show the occupants panel in current room." },
+ { "hide", "Hide the occupants panel in current room." },
+ { "show jid", "Show jid in the occupants panel in current room." },
+ { "hide jid", "Hide jid in the occupants panel in current room." },
+ { "default show|hide", "Whether occupants are shown by default in new rooms." },
+ { "default show|hide jid", "Whether occupants jids are shown by default in new rooms." },
+ { "size ", "Percentage of the screen taken by the occupants list in rooms (1-99)." })
+ CMD_NOEXAMPLES
+ },
{ "/form",
cmd_form, parse_args, 1, 2, NULL,
- { "/form show|submit|cancel|help [tag]", "Form handling.",
- { "/form show|submit|cancel|help [tag]",
- "-----------------------------------",
- "Form configuration.",
- "",
- "show : Show the current form.",
- "submit : Submit the current form.",
- "cancel : Cancel changes to the current form.",
- "help [tag] : Display help for form, or a specific field.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/form show",
+ "/form submit",
+ "/form cancel",
+ "/form help []")
+ CMD_DESC(
+ "Form configuration.")
+ CMD_ARGS(
+ { "show", "Show the current form." },
+ { "submit", "Submit the current form." },
+ { "cancel", "Cancel changes to the current form." },
+ { "help []", "Display help for form, or a specific field." })
+ CMD_NOEXAMPLES
+ },
{ "/rooms",
cmd_rooms, parse_args, 0, 1, NULL,
- { "/rooms [conference-service]", "List chat rooms.",
- { "/rooms [conference-service]",
- "---------------------------",
- "List the chat rooms available at the specified conference service",
- "",
- "conference-service : The conference service to query.",
- "",
- "If no argument is supplied, the account preference 'muc.service' is used, 'conference.' by default.",
- "",
- "Example: /rooms conference.jabber.org",
- "Example: /rooms (if logged in as me@server.org, is equivalent to /rooms conference.server.org)",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/rooms []")
+ CMD_DESC(
+ "List the chat rooms available at the specified conference service. "
+ "If no argument is supplied, the account preference 'muc.service' is used, 'conference.' by default.")
+ CMD_ARGS(
+ { "", "The conference service to query." })
+ CMD_EXAMPLES(
+ "/rooms conference.jabber.org")
+ },
{ "/bookmark",
cmd_bookmark, parse_args, 0, 8, NULL,
- { "/bookmark [command] [args..]", "Manage bookmarks.",
- { "/bookmark [command] [args..]",
- "----------------------------",
- "Manage bookmarks and join bookmarked rooms.",
- "",
- "command : list|add|update|remove|join",
- "",
- "list : List all bookmarks.",
- "add room@server [prop value..] : Add a bookmark for room@server with the following optional properties:",
- " nick value : Nickname used in the chat room",
- " password value : Password if required, may be stored in plaintext on your server",
- " autojoin on|off : Whether to join the room automatically on login.",
- "update room@server [prop value..] : Update any of the above properties associated with the bookmark.",
- "remove room@server : Remove the bookmark for room@server.",
- "join room@server : Join room using the properties associated with the bookmark.",
- "",
- "In a chat room, /bookmark with no arguments will bookmark the current room, setting autojoin to \"on\".",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/bookmark",
+ "/bookmark list",
+ "/bookmark add [nick ] [password ] [autojoin on|off]",
+ "/bookmark update [nick ] [password ] [autojoin on|off]",
+ "/bookmark remove ",
+ "/bookmark join ")
+ CMD_DESC(
+ "Manage bookmarks and join bookmarked rooms. "
+ "In a chat room, no arguments will bookmark the current room, setting autojoin to \"on\".")
+ CMD_ARGS(
+ { "list", "List all bookmarks." },
+ { "add ", "Add a bookmark." },
+ { "remove ", "Remove a bookmark." },
+ { "update ", "Update the properties associated with a bookmark." },
+ { "nick ", "Nickname used in the chat room." },
+ { "password ", "Password if required, may be stored in plaintext on your server." },
+ { "autojoin on|off", "Whether to join the room automatically on login." },
+ { "join ", "Join room using the properties associated with the bookmark." })
+ CMD_NOEXAMPLES
+ },
{ "/disco",
cmd_disco, parse_args, 1, 2, NULL,
- { "/disco info|items entity", "Service discovery.",
- { "/disco info|items entity",
- "---------------------",
- "Find out information about an entities supported services.",
- "",
- "info : List protocols and features supported by an entity.",
- "items : List items associated with an entity.",
- "entity : Jabber ID.",
- "",
- "Example: /disco info myserver.org",
- "Example: /disco items myserver.org",
- "Example: /disco items conference.jabber.org",
- "Example: /disco info myfriend@server.com/laptop",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_DISCOVERY)
+ CMD_SYN(
+ "/disco info []",
+ "/disco items []")
+ CMD_DESC(
+ "Find out information about an entities supported services. "
+ "Calling with no arguments will query the server you are currently connected to.")
+ CMD_ARGS(
+ { "info []", "List protocols and features supported by an entity." },
+ { "items []", "List items associated with an entity." })
+ CMD_EXAMPLES(
+ "/disco info",
+ "/disco items myserver.org",
+ "/disco items conference.jabber.org",
+ "/disco info myfriend@server.com/laptop")
+ },
{ "/nick",
cmd_nick, parse_args_with_freetext, 1, 1, NULL,
- { "/nick nickname", "Change nickname in chat room.",
- { "/nick nickname",
- "--------------",
- "Change the name by which other members of a chat room see you.",
- "",
- "nickname : The new nickname.",
- "",
- "Example: /nick kai hansen",
- "Example: /nick bob",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_GROUPCHAT)
+ CMD_SYN(
+ "/nick ")
+ CMD_DESC(
+ "Change your nickname in the current chat room.")
+ CMD_ARGS(
+ { "", "Your new nickname." })
+ CMD_NOEXAMPLES
+ },
{ "/win",
cmd_win, parse_args, 1, 1, NULL,
- { "/win num", "View a window.",
- { "/win num",
- "--------",
- "Show the contents of a specific window in the main window area.",
- "",
- "num - Window number to display.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_UI)
+ CMD_SYN(
+ "/win ")
+ CMD_DESC(
+ "Move to the specified window.")
+ CMD_ARGS(
+ { "", "Window number to display." })
+ CMD_NOEXAMPLES
+ },
{ "/wins",
cmd_wins, parse_args, 0, 3, NULL,
- { "/wins [tidy|prune|swap] [source target]", "List or tidy active windows.",
- { "/wins [tidy|prune|swap] [source target]",
- "---------------------------------------",
- "Show a list of windows, or tidy or swap.",
- "",
- "tidy : Move windows so there are no gaps.",
- "prune : Close all windows with no unread messages, and then tidy as above.",
- "swap source target : Swap windows, target may be an empty position.",
- "",
- "Passing no argument will list all currently active windows and information about their usage.",
- NULL } } },
+ CMD_TAGS(
+ CMD_TAG_UI)
+ CMD_SYN(
+ "/wins tidy",
+ "/wins prune",
+ "/wins swap