MINOR: cfgparse/bind: suggest correct spelling for unknown bind keywords
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Mar 2021 09:14:07 +0000 (10:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Mar 2021 13:13:21 +0000 (14:13 +0100)
commit433b05fa6448c1cda47dfadc5abcfa8d80ae1ff1
treeb1c188099bab52c30acc8daa6aa9454ba3dce8ab
parent49c2b45c1d141ac63c4efae1541b5c8e2f61e520
MINOR: cfgparse/bind: suggest correct spelling for unknown bind keywords

Just like with the server keywords, now's the turn of "bind" keywords.
The difference is that 100% of the bind keywords are registered, thus
we do not need the list of extra keywords.

There are multiple bind line parsers today, all were updated:
  - peers
  - log
  - dgram-bind
  - cli

$ printf "listen f\nbind :8000 tcut\n" | ./haproxy -c -f /dev/stdin
[NOTICE] 070/101358 (25146) : haproxy version is 2.4-dev11-7b8787-26
[NOTICE] 070/101358 (25146) : path to executable is ./haproxy
[ALERT] 070/101358 (25146) : parsing [/dev/stdin:2] : 'bind :8000' unknown keyword 'tcut'; did you mean 'tcp-ut' maybe ?
[ALERT] 070/101358 (25146) : Error(s) found in configuration file : /dev/stdin
[ALERT] 070/101358 (25146) : Fatal errors found in configuration.
include/haproxy/listener.h
src/cfgparse-listen.c
src/cfgparse.c
src/cli.c
src/listener.c
src/log.c