Mercurial > irccd
comparison doc/src/irccd-test.md @ 620:c79ae2987955
Irccd: create a brand new irccd-test executable, closes #569 @3h
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 21 Dec 2017 21:55:57 +0100 |
parents | |
children | ebe561276c33 |
comparison
equal
deleted
inserted
replaced
619:a2ece4ed9f5d | 620:c79ae2987955 |
---|---|
1 % irccd-test | |
2 % David Demelier | |
3 % 2017-12-21 | |
4 | |
5 The `irccd-test` program is a simple utility to test plugins on the command | |
6 line. | |
7 | |
8 It opens a prompt that waits for user input, each line consist of a specific | |
9 plugin event. These are mostly the same as the Javascript API offers. | |
10 | |
11 If compiled with [libedit][] library, the prompt offers basic completion for the | |
12 plugin events. | |
13 | |
14 When a event requires a server, a fake debugging server is created if it does | |
15 not exists already. That fake server simply prints every command on the command | |
16 line instead of sending them through IRC. | |
17 | |
18 # Synopsis | |
19 | |
20 $ irccd-test [options] plugin-identifier | |
21 $ irccd-test [options] /path/to/plugin | |
22 | |
23 # Options | |
24 | |
25 The following options are available: | |
26 | |
27 - `-c, --config file`: specify the configuration file. | |
28 | |
29 # Commands | |
30 | |
31 List of available commands: | |
32 | |
33 - onCommand server origin channel message | |
34 - onConnect server | |
35 - onInvite server origin channel target | |
36 - onJoin server origin channel | |
37 - onKick server origin channel reason | |
38 - onLoad | |
39 - onMe server origin channel message | |
40 - onMessage server origin channel message | |
41 - onMode server origin channel mode limit user mask | |
42 - onNames server channel nick1 nick2 nickN | |
43 - onNick server origin nickname | |
44 - onNotice server origin channel nickname | |
45 - onPart server origin channel reason | |
46 - onReload | |
47 - onTopic server origin channel topic | |
48 - onUnload | |
49 - onWhois server nick user host realname chan1 chan2 chanN | |
50 | |
51 # Example | |
52 | |
53 Example by testing the **ask** plugin. | |
54 | |
55 $ irccd-test ask | |
56 > onCommand local #test jean will I be rich? | |
57 local: connect | |
58 local: message jean #test, No | |
59 > onCommand local #test jean are you sure? | |
60 local: message jean #test, Yes | |
61 | |
62 As you can see in this example, the first onCommand generates two server | |
63 commands, the first connect attempt is being made because irccd-test creates a | |
64 new fake server on the fly as **local** was not existing yet. You can ignore | |
65 this. | |
66 | |
67 Then, the server sent a message on the **#test** channel and said **No**. The | |
68 second onCommand event did not generate a connect event because the local server | |
69 was already present. It said on the same server **No** though. | |
70 | |
71 [libedit]: http://thrysoee.dk/editline/ |