Mercurial > irccd
changeset 1032:06b35c32a179
man: add example in libirccd-rule
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 02 Mar 2021 20:03:00 +0100 |
parents | a20060091063 |
children | 330a5db51c62 |
files | man/libirccd-rule.3 |
diffstat | 1 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/man/libirccd-rule.3 Tue Mar 02 20:01:00 2021 +0100 +++ b/man/libirccd-rule.3 Tue Mar 02 20:03:00 2021 +0100 @@ -190,6 +190,26 @@ and .Fn irc_rule_matchlist returns non-zero if the rule is allowed. +.\" EXAMPLES +.Sh EXAMPLES +Create a rule that matches servers +.Dq example +or +.Dq wanadoo +on channel +.Dq #staff +for the plugin +.Dq hangman +and drop it. +.Bd -literal -offset indent +struct irc_rule *r; + +r = irc_rule_new(IRC_RULE_DROP); +irc_rule_add(r->servers, "example"); +irc_rule_add(r->servers, "wanadoo"); +irc_rule_add(r->channels, "#staff"); +irc_rule_add(r->plugins, "hangman"); +.Ed .\" ERRORS .Sh ERRORS The function