diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/command/command.c | 190 |
1 files changed, 109 insertions, 81 deletions
diff --git a/src/command/command.c b/src/command/command.c index a3701614..7cc3884a 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -116,8 +116,10 @@ static struct cmd_t command_defs[] = { "/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.", NULL } } }, @@ -135,9 +137,11 @@ static struct cmd_t command_defs[] = { "/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.", NULL } } }, @@ -156,9 +160,11 @@ static struct cmd_t command_defs[] = { "/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.", NULL } } }, @@ -169,7 +175,9 @@ static struct cmd_t command_defs[] = { "/roster [command] [args..]", "--------------------------", "Manage your roster, and roster display settings.", + "", "command - online|show|hide|by|size|add|remove|nick|clearnick", + "", "online - Show all online contacts in your roster.", "show - Show the roster panel.", "show offline - Show offline contacts in the roster panel.", @@ -185,6 +193,7 @@ static struct cmd_t command_defs[] = "remove jid - Removes an item from the roster.", "nick jid nick - Change a contacts nickname.", "clearnick jid - Removes the current nickname.", + "", "Passing no arguments lists all contacts in your roster.", NULL } } }, @@ -194,9 +203,11 @@ static struct cmd_t command_defs[] = { "/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.", NULL } } }, @@ -206,8 +217,10 @@ static struct cmd_t command_defs[] = { "/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.", NULL } } }, @@ -218,8 +231,10 @@ static struct cmd_t command_defs[] = { "/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.", NULL } } }, @@ -229,8 +244,10 @@ static struct cmd_t command_defs[] = { "/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.", NULL } } }, @@ -241,8 +258,10 @@ static struct cmd_t command_defs[] = { "/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.", NULL } } }, @@ -252,6 +271,7 @@ static struct cmd_t command_defs[] = { "/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.", @@ -264,10 +284,12 @@ static struct cmd_t command_defs[] = { "/join room[@server] [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, 'conference.<domainpart>' by default.", "room@server - Full room JID.", "nick value - Nickname to use in the room", "password value - Password if the room requires it.", + "", "If no nickname is specfied 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.", NULL } } }, @@ -286,6 +308,7 @@ static struct cmd_t command_defs[] = { "/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 } } }, @@ -304,6 +327,7 @@ static struct cmd_t command_defs[] = { "/decline room", "-------------", "Decline a chat room ivivation.", + "", "room - The room for the invite you wish to decline.", NULL } } }, @@ -313,6 +337,7 @@ static struct cmd_t command_defs[] = { "/room accept|destroy|config", "---------------------------", "Chat room configuration.", + "", "accept - Accept default room configuration.", "destroy - Reject default room configuration.", "config - Edit room configuration.", @@ -324,6 +349,7 @@ static struct cmd_t command_defs[] = { "/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 } } }, @@ -334,6 +360,7 @@ static struct cmd_t command_defs[] = { "/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 } } }, @@ -344,6 +371,7 @@ static struct cmd_t command_defs[] = { "/subject set|clear [subject]", "----------------------------", "Set or clear room subject.", + "", "set subject - Set the room subject.", "clear - Clear the room subject.", NULL } } }, @@ -354,8 +382,10 @@ static struct cmd_t command_defs[] = { "/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 } } }, @@ -365,8 +395,10 @@ static struct cmd_t command_defs[] = { "/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 } } }, @@ -376,6 +408,7 @@ static struct cmd_t command_defs[] = { "/occupants show|hide|default|size [show|hide] [percent]", "-------------------------------------------------------", "Show or hide room occupants, and occupants panel display settings.", + "", "show - Show the occupants panel in chat rooms.", "hide - Hide the occupants panel in chat rooms.", "default show|hide - Whether occupants are shown by default in new rooms, 'show' or 'hide'", @@ -387,7 +420,8 @@ static struct cmd_t command_defs[] = { "/form show|submit|cancel|help [tag]", "Form handling.", { "/form show|submit|cancel|help [tag]", "-----------------------------------", - "Form configuration." + "Form configuration.", + "", "show - Show the current form.", "submit - Submit the current form.", "cancel - Cancel changes to the current form.", @@ -400,45 +434,43 @@ static struct cmd_t command_defs[] = { "/rooms [conference-service]", "---------------------------", "List the chat rooms available at the specified conference service", - "If no argument is supplied, the account preference 'muc.service' is used, which is 'conference.<domain-part>' by default.", "", - "Example : /rooms conference.jabber.org", - "Example : /rooms (if logged in as me@server.org, is equivalent to /rooms conference.server.org)", + "conference-service - The conference service to query.", + "", + "If no argument is supplied, the account preference 'muc.service' is used, 'conference.<domain-part>' by default.", NULL } } }, { "/bookmark", cmd_bookmark, parse_args, 0, 8, NULL, - { "/bookmark [list|add|update|remove|join] [room@server] [nick value] [password value] [autojoin on|off]", "Manage bookmarks.", - { "/bookmark [list|add|update|remove|join] [room@server] [nick value] [password value] [autojoin on|off]", - "---------------------------------------------------------------------------------------------------", - "Manage bookmarks.", - "list: List all bookmarks.", - "add: Add a bookmark for room@server with the following optional properties:", - " nick: Nickname used in the chat room", - " password: Password for private rooms, note this may be stored in plaintext on your server", - " autojoin: Whether to join the room automatically on login \"on\" or \"off\".", - "update: Update any of the above properties associated with the bookmark.", - "remove: Remove the bookmark for room@server.", - "join: Join room@server using the properties associated with the bookmark.", - "When in a chat room, the /bookmark command with no arguments will bookmark the current room with the current settings, and set autojoin to \"on\".", + { "/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 } } }, { "/disco", cmd_disco, parse_args, 1, 2, NULL, - { "/disco command entity", "Service discovery.", - { "/disco command entity", + { "/disco info|items entity", "Service discovery.", + { "/disco info|items entity", "---------------------", "Find out information about an entities supported services.", - "Command may be one of:", - "info: List protocols and features supported by an entity.", - "items: List items associated with an entity.", - "", - "The entity must be a 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", + "info - List protocols and features supported by an entity.", + "items - List items associated with an entity.", + "entity - Jabber ID.", NULL } } }, { "/nick", @@ -447,52 +479,49 @@ static struct cmd_t command_defs[] = { "/nick nickname", "--------------", "Change the name by which other members of a chat room see you.", - "This command is only valid when called within a chat room window.", "", - "Example : /nick kai hansen", - "Example : /nick bob", + "nickname - The new nickname.", NULL } } }, { "/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 } } }, { "/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]", - "-----------------------------------------", + { "/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.", - "tidy : Shuffle 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.", NULL } } }, { "/sub", cmd_sub, parse_args, 1, 2, NULL, - { "/sub command [jid]", "Manage subscriptions.", - { "/sub command [jid]", - "------------------", - "command : One of the following,", - "request : Send a subscription request to the user to be informed of their", - " : presence.", - "allow : Approve a contact's subscription reqeust to see your presence.", - "deny : Remove subscription for a contact, or deny a request", - "show : Show subscriprion status for a contact.", - "sent : Show all sent subscription requests pending a response.", - "received : Show all received subscription requests awaiting your response.", - "", - "The optional 'jid' parameter only applys to 'request', 'allow', 'deny' and 'show'", - "If it is omitted the contact of the current window is used.", - "", - "Example: /sub request myfriend@jabber.org", - "Example: /sub allow myfriend@jabber.org", - "Example: /sub request (whilst in chat with contact)", - "Example: /sub sent", + { "/sub request|allow|deny|show|sent|received [jid]", "Manage subscriptions.", + { "/sub request|allow|deny|show|sent|received [jid]", + "------------------------------------------------", + "Manage subscriptions to contact presence.", + "", + "request [jid] - Send a subscription request to the user.", + "allow [jid] - Approve a contact's subscription reqeust.", + "deny [jid] - Remove subscription for a contact, or deny a request", + "show [jid] - Show subscriprion status for a contact.", + "sent - Show all sent subscription requests pending a response.", + "received - Show all received subscription requests awaiting your response.", + "", + "If jid is omitted, the contact of the current window is used.", NULL } } }, { "/tiny", @@ -500,9 +529,9 @@ static struct cmd_t command_defs[] = { "/tiny url", "Send url as tinyurl in current chat.", { "/tiny url", "---------", - "Send the url as a tiny url.", + "Send url as tinyurl in current chat.", "", - "Example : /tiny http://www.profanity.im", + "url - The url to make tiny.", NULL } } }, { "/who", @@ -510,31 +539,30 @@ static struct cmd_t command_defs[] = { "/who [status|role|affiliation] [group]", "Show contacts/room occupants with chosen status, role or affiliation", { "/who [status|role|affiliation] [group]", "--------------------------------------", - "Normal usage:", - "Status may be one of - online, offline, away, dnd, xa, chat, available, unavailable, or any where:", - "online : Contacts that are online, chat, away, xa, dnd", - "available : Contacts that are available for chat - online, chat.", - "unavailable : Contacts that are not available for chat - offline, away, xa, dnd.", - "any : Contacts with any status (same as calling with no argument).", - "", - "The group argument filters the list by that group.", + "Show contacts/room occupants with chosen status, role or affiliation", "", - "In a chat room, a role or affiliation may also be supplied instead of status.", - "Roles: moderator, participant, visitor", - "Affiliations: owner, admin, member", + "status - online|offline|away|dnd|xa|chat|available|unavailable|any", + " online - Contacts that are online, chat, away, xa, dnd", + " available - Contacts that are available for chat - online, chat.", + " unavailable - Contacts that are not available for chat - offline, away, xa, dnd.", + " any - Contacts with any status (same as calling with no argument).", + "role - moderator|participant|visitor", + "affiliation - owner|admin|member", + "group - Filter the results by the specfied group.", NULL } } }, { "/close", cmd_close, parse_args, 0, 1, NULL, - { "/close [win|read|all]", "Close windows.", - { "/close [win|read|all]", + { "/close [num|read|all]", "Close windows.", + { "/close [num|read|all]", "---------------------", + "Close the current window, or a number of windows.", + "", + "num - Close the specified window.", + "all - Close all windows.", + "read - Close all windows that have no new messages.", + "", "Passing no argument will close the current window.", - "2,3,4,5,6,7,8,9 or 0 : Close the specified window.", - "all : Close all currently open windows.", - "read : Close all windows that have no new messages.", - "The console window cannot be closed.", - "If in a chat room, you will leave the room.", NULL } } }, { "/clear", @@ -557,8 +585,8 @@ static struct cmd_t command_defs[] = cmd_privileges, parse_args, 1, 1, &cons_privileges_setting, { "/privileges on|off", "Show occupant privileges in chat rooms.", { "/privileges on|off", - "---------------------------", - "If enabled the room roster will be broken down my role, and role information will be showin in the room.", + "------------------", + "If enabled the room occupants panel will be grouped by role, and role information will be shown in the room.", NULL } } }, { "/beep", @@ -576,7 +604,7 @@ static struct cmd_t command_defs[] = { "/presence on|off", "Show the contacts presence in the titlebar.", { "/presence on|off", "----------------", - "Switch display of the contacts presence on or off.", + "Switch display of the contacts presence in the titlebar on or off.", NULL } } }, { "/wrap", @@ -595,7 +623,7 @@ static struct cmd_t command_defs[] = "Configure time precision for the main window.", NULL } } }, - { "/inpblock", + { "/inpblock", // TODO review cmd_inpblock, parse_args, 2, 2, &cons_inpblock_setting, { "/inpblock timeout|dynamic [millis|on|off]", "Input blocking delay (dynamic or static).", { "/inpblock timeout|dynamic [millis|on|off]", |