comparison mcabber/src/commands.c @ 868:cefdaeb42e67

Add online /help command We use help files stored in "$DATA_DIR/mcabber/help/$lang/", with $lang defaulting to "en". The DATA_DIR location can be set using configure --with-datadir="...".
author Mikael Berthe <mikael@lilotux.net>
date Thu, 25 May 2006 18:20:52 +0200
parents 7f056c566569
children ee39f6d94d43
comparison
equal deleted inserted replaced
867:7f056c566569 868:cefdaeb42e67
20 */ 20 */
21 21
22 #include <string.h> 22 #include <string.h>
23 23
24 #include "commands.h" 24 #include "commands.h"
25 #include "help.h"
25 #include "jabglue.h" 26 #include "jabglue.h"
26 #include "roster.h" 27 #include "roster.h"
27 #include "screen.h" 28 #include "screen.h"
28 #include "compl.h" 29 #include "compl.h"
29 #include "hooks.h" 30 #include "hooks.h"
56 static void do_room(char *arg); 57 static void do_room(char *arg);
57 static void do_authorization(char *arg); 58 static void do_authorization(char *arg);
58 static void do_version(char *arg); 59 static void do_version(char *arg);
59 static void do_request(char *arg); 60 static void do_request(char *arg);
60 static void do_event(char *arg); 61 static void do_event(char *arg);
62 static void do_help(char *arg);
61 63
62 // Global variable for the commands list 64 // Global variable for the commands list
63 static GSList *Commands; 65 static GSList *Commands;
64 66
65 67
94 cmd_add("connect", "Connect to the server", 0, 0, &do_connect); 96 cmd_add("connect", "Connect to the server", 0, 0, &do_connect);
95 cmd_add("del", "Delete the current buddy", 0, 0, &do_del); 97 cmd_add("del", "Delete the current buddy", 0, 0, &do_del);
96 cmd_add("disconnect", "Disconnect from server", 0, 0, &do_disconnect); 98 cmd_add("disconnect", "Disconnect from server", 0, 0, &do_disconnect);
97 cmd_add("event", "Process an event", COMPL_EVENTSID, COMPL_EVENTS, &do_event); 99 cmd_add("event", "Process an event", COMPL_EVENTSID, COMPL_EVENTS, &do_event);
98 cmd_add("group", "Change group display settings", COMPL_GROUP, 0, &do_group); 100 cmd_add("group", "Change group display settings", COMPL_GROUP, 0, &do_group);
99 //cmd_add("help", "Display some help", COMPL_CMD, 0, NULL); 101 cmd_add("help", "Display some help", COMPL_CMD, 0, &do_help);
100 cmd_add("info", "Show basic info on current buddy", 0, 0, &do_info); 102 cmd_add("info", "Show basic info on current buddy", 0, 0, &do_info);
101 cmd_add("move", "Move the current buddy to another group", COMPL_GROUPNAME, 103 cmd_add("move", "Move the current buddy to another group", COMPL_GROUPNAME,
102 0, &do_move); 104 0, &do_move);
103 cmd_add("msay", "Send a multi-lines message to the selected buddy", 105 cmd_add("msay", "Send a multi-lines message to the selected buddy",
104 COMPL_MULTILINE, 0, &do_msay); 106 COMPL_MULTILINE, 0, &do_msay);
2216 static void do_disconnect(char *arg) 2218 static void do_disconnect(char *arg)
2217 { 2219 {
2218 jb_disconnect(); 2220 jb_disconnect();
2219 } 2221 }
2220 2222
2223 static void do_help(char *arg)
2224 {
2225 help_process(arg);
2226 }
2227
2221 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ 2228 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */