mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-14 15:09:14 +02:00
MINOR: management: add some basic keyword dump infrastructure
It's difficult from outside haproxy to detect the supported keywords
and syntax. Interestingly, many of our modern keywords are enumerated
since they're registered from constructors, so it's not very hard to
enumerate most of them.
This patch creates some basic infrastructure to support dumping existing
keywords from different classes on stdout. The format will differ depending
on the classes, but the idea is that the output could easily be passed to
a script that generates some simple syntax highlighting rules, completion
rules for editors, syntax checkers or config parsers.
The principle chosen here is that if "-dK" is passed on the command-line,
at the end of the parsing the registered keywords will be dumped for the
requested classes passed after "-dK". Special name "help" will show known
classes, while "all" will execute all of them. The reason for doing that
after the end of the config processor is that it will also enumerate
internally-generated keywords, Lua or even those loaded from external
code (e.g. if an add-on is loaded using LD_PRELOAD). A typical way to
call this with a valid config would be:
./haproxy -dKall -q -c -f /path/to/config
If there's no config available, feeding /dev/null will also do the job,
though it will not be able to detect dynamically created keywords, of
course.
This patch also updates the management doc.
For now nothing but the help is listed, various subsystems will follow
in subsequent patches.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#define MODE_CHECK_CONDITION 0x800 /* -cc mode */
|
||||
#define MODE_STOPPING 0x1000 /* the process is in the deinit phase, the event loop is not running anymore. */
|
||||
#define MODE_DUMP_LIBS 0x2000 /* dump loaded libraries at the end of init phase */
|
||||
#define MODE_DUMP_KWD 0x4000 /* dump registered keywords (see kwd_dump for the list) */
|
||||
|
||||
/* list of last checks to perform, depending on config options */
|
||||
#define LSTCHK_CAP_BIND 0x00000001 /* check that we can bind to any port */
|
||||
|
||||
Reference in New Issue
Block a user