znc/znc — pull request #406 by TheWug (2013-09-18 07:34:33+00:00)
Title: Alias module (and new CString functions)

Added some utility functions to CString
- Join (works like python's join, except takes a pair of iterators)
- Convert (converts a string into some other type using an intermediate stringstream)
- Doxygen comments on both of those methods

Those are both template functions so their declarations should stay in the header file

Added an 'alias' module, which performs znc-side interception of client commands
- Syntax: supports all ExpandString syntax, as well as %?n+%
- n is an integer and denotes the numeric index of the token to substitute with (zero is the alias name)
- the presence of ? allows the token to be optional (otherwise its absence will cause the command to fail)
- the presence of + pulls in all following tokens as well
- if a command encounters an error (usually a missing parameter), znc returns a 461 (ERR_NEEDMOREPARAMS) to the client

The 'alias' module depends on the new CString functions, and will not work in versions of znc prior to this commit without being patched to do so.

The 'alias' module stores its commands using the module registry.

You can configure the alias module at runtime by interacting with '*alias'. Issue the command "help" for commands and their usage.