diff options
Diffstat (limited to 'doc/en')
-rw-r--r-- | doc/en/autogen/plugin_api/completions.txt | 2 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/infolists.txt | 2 | ||||
-rw-r--r-- | doc/en/autogen/user/rmodifier_commands.txt | 25 | ||||
-rw-r--r-- | doc/en/autogen/user/rmodifier_options.txt | 5 | ||||
-rw-r--r-- | doc/en/weechat_user.en.txt | 91 |
5 files changed, 110 insertions, 15 deletions
diff --git a/doc/en/autogen/plugin_api/completions.txt b/doc/en/autogen/plugin_api/completions.txt index d3409e6b6..85dc06699 100644 --- a/doc/en/autogen/plugin_api/completions.txt +++ b/doc/en/autogen/plugin_api/completions.txt @@ -46,6 +46,8 @@ | relay | relay_relays | protocol.name of current relays for relay plugin +| rmodifier | rmodifier | list of rmodifiers + | ruby | ruby_script | list of scripts | tcl | tcl_script | list of scripts diff --git a/doc/en/autogen/plugin_api/infolists.txt b/doc/en/autogen/plugin_api/infolists.txt index c734fc2a4..9eee2fec8 100644 --- a/doc/en/autogen/plugin_api/infolists.txt +++ b/doc/en/autogen/plugin_api/infolists.txt @@ -22,6 +22,8 @@ | relay | relay | list of relay clients | relay pointer (optional) | - +| rmodifier | rmodifier | list of rmodifiers | rmodifier pointer (optional) | rmodifier name (can start or end with "*" as joker) (optional) + | ruby | ruby_script | list of scripts | script pointer (optional) | script name (can start or end with "*" as wildcard) (optional) | tcl | tcl_script | list of scripts | script pointer (optional) | script name (can start or end with "*" as wildcard) (optional) diff --git a/doc/en/autogen/user/rmodifier_commands.txt b/doc/en/autogen/user/rmodifier_commands.txt new file mode 100644 index 000000000..42ef6b896 --- /dev/null +++ b/doc/en/autogen/user/rmodifier_commands.txt @@ -0,0 +1,25 @@ +• *`/rmodifier`* `[list] | [listdefault] | [add name modifiers groups regex] | [del name|-all [name...]] | [default -yes]`:: + +........................................ + alter modifier strings with regular expressions + + list: list all rmodifiers + listdefault: list default rmodifiers + add: add a rmodifier + name: name of rmodifier + modifiers: comma separated list of modifiers + groups: action on groups found: comma separated list of groups (from 1 to 9) with optional "*" after number to hide group + regex: regular expression + del: delete a rmodifier + -all: delete all rmodifiers + default: restore default rmodifiers + + Examples: + hide everything typed after a command /password: + /rmodifier add password input_text_display 1,2* ^(/password +)(.*) + delete rmodifier "password": + /rmodifier del password + delete all rmodifiers: + /rmodifier del -all +........................................ + diff --git a/doc/en/autogen/user/rmodifier_options.txt b/doc/en/autogen/user/rmodifier_options.txt new file mode 100644 index 000000000..358ae2769 --- /dev/null +++ b/doc/en/autogen/user/rmodifier_options.txt @@ -0,0 +1,5 @@ +* *rmodifier.look.hide_char* +** description: char used to hide part of a string +** type: string +** values: any string (default value: "*") + diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt index 854657c9b..88c589e6f 100644 --- a/doc/en/weechat_user.en.txt +++ b/doc/en/weechat_user.en.txt @@ -22,7 +22,7 @@ Features Main features are: -* multi-protocols (IRC and other soon) +* multi-protocols (IRC, Jabber) * multi-servers connection (with SSL, IPv6, proxy) * many GUI: Curses (wxWidgets, Gtk and Qt under development) * small, fast and light @@ -923,20 +923,21 @@ Default plugins are: [width="50%",cols="^1,5",options="header"] |======================================== -| Plugin | Description -| alias | Define alias for commands -| aspell | Spell checking for command line -| charset | Charset decoding/encoding for buffers -| demo | Demo plugin (not compiled by default) -| fifo | FIFO pipe used to remotely send commands to WeeChat -| irc | IRC chat protocol -| logger | Log buffers to files -| perl | Perl scripting API -| python | Python scripting API -| ruby | Ruby scripting API -| lua | Lua scripting API -| tcl | Tcl scripting API -| xfer | File transfer and direct chat +| Plugin | Description +| alias | Define alias for commands +| aspell | Spell checking for command line +| charset | Charset decoding/encoding for buffers +| demo | Demo plugin (not compiled by default) +| fifo | FIFO pipe used to remotely send commands to WeeChat +| irc | IRC chat protocol +| logger | Log buffers to files +| rmodifier | Alter modifier strings with regular expressions +| perl | Perl scripting API +| python | Python scripting API +| ruby | Ruby scripting API +| lua | Lua scripting API +| tcl | Tcl scripting API +| xfer | File transfer and direct chat |======================================== [[alias_plugin]] @@ -1549,6 +1550,66 @@ You'll have following files: | #chan2.weechatlog ........................................ +[[rmodifier_plugin]] +Rmodifier plugin +~~~~~~~~~~~~~~~~ + +The Rmodifier plugin lets you alter modifier strings using regular expressions. +Typical use is to hide password when you type them, or when WeeChat saves +them in command history. For example, it is possible to replace each char in +these passwords by "*". + +[[rmodifier_options]] +Options (rmodifier.conf) +^^^^^^^^^^^^^^^^^^^^^^^^ + +include::autogen/user/rmodifier_options.txt[] + +[[rmodifier_commands]] +Commands +^^^^^^^^ + +include::autogen/user/rmodifier_commands.txt[] + +[[rmodifier_creation]] +Rmodifier creation +^^^^^^^^^^^^^^^^^^ + +A rmodifier consists of three elements: + +. one or more "modifiers" +. a regular expression, to capture "groups" +. a string that describes output using number of "groups" captured in regular + expression + +For list of modifiers used by WeeChat or plugins, see +''WeeChat Plugin API Reference', function 'weechat_hook_modifier'. + +For each captured group, following actions are possible: + +* keep group as-is (by using group number) +* replace all chars in group to hide content (group number + "*") +* remove group (if group is not used in string) + +Example of default rmodifier for command `/oper`: + +* modifiers: `history_add,input_text_display` +** `history_add`: called when WeeChat stores command in history +** `input_text_display`: called when command line has changed + (applies only on display, not content of command line) +* regular expression: `^(/oper +\S+ +)(.*)` +* groupes: `1,2*` + +Each time modifiers "history_add" or "input_text_display" are called, regular +expression is checked. If string matches, then it is replaced by captured groups, +as defined in string with groups. + +In this example, we keep number 1 as-is, and we replace all chars of group 2 by +replacement char defined in configuration (option 'rmodifier.look.hide_char'). + +If command line contains: `/oper nick password` then display becomes: +`/oper nick ********`. + [[scripts_plugins]] Scripts plugins ~~~~~~~~~~~~~~~ |