]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cfgparse: suggest correct spelling for unknown words in proxy sections
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Mar 2021 08:14:19 +0000 (09:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Mar 2021 13:13:21 +0000 (14:13 +0100)
commitc0ff6794814943e5483fdcea51ee8b806fd94c81
tree3b76d0e930226ae48b2a0e5c217930d6fc93387b
parente2afcc45092c063464e1f612374aa4b002cd0b66
MINOR: cfgparse: suggest correct spelling for unknown words in proxy sections

Let's start by the largest keyword list, the listeners. Many keywords were
still not part of a list, so a common_kw_list array was added to list the
not enumerated ones. Now for example, typing "tmout" properly suggests
"timeout":

  $ printf "frontend f\ntmout client 10s\n" | ./haproxy -c -f /dev/stdin
  [NOTICE] 070/091355 (22545) : haproxy version is 2.4-dev11-3b728a-21
  [NOTICE] 070/091355 (22545) : path to executable is ./haproxy
  [ALERT] 070/091355 (22545) : parsing [/dev/stdin:2] : unknown keyword 'tmout' in 'frontend' section; did you mean 'timeout' maybe ?
  [ALERT] 070/091355 (22545) : Error(s) found in configuration file : /dev/stdin
  [ALERT] 070/091355 (22545) : Fatal errors found in configuration.
src/cfgparse-listen.c