MEDIUM: vars: also support format strings in CLI's "set var" command
authorWilly Tarreau <w@1wt.eu>
Fri, 3 Sep 2021 07:47:37 +0000 (09:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 3 Sep 2021 09:01:48 +0000 (11:01 +0200)
commite93bff410761bff60f86b74abc9373b80f2c2c09
treeba797912cf5075aeac41de8d3d366b571a870c19
parent753d4db5f3b70a2feeb90031ba9b37e919a06090
MEDIUM: vars: also support format strings in CLI's "set var" command

Most often "set var" on the CLI is used to set a string, and using only
expressions is not always convenient, particularly when trying to
concatenate variables sur as host names and paths.

Now the "set var" command supports an optional keyword before the value
to indicate its type. "expr" takes an expression just like before this
patch, and "fmt" a format string, making it work like the "set-var-fmt"
actions.

The VTC was updated to include a test on the format string.
doc/management.txt
reg-tests/sample_fetches/vars.vtc
src/vars.c