Hi Adis, On Wed, Jan 22, 2020 at 10:38:55AM +0100, Adis Nezirovic wrote: > Hello, > > Here is a patch to extend 'show table' with multiple filters. We already > have this functionality in Lua (also adapted here to use the same definition > for number of filters)
Oh that's really great, as I've been missing that feature quite a few times! > The current code is somewhat relaxed about the extra data (garbage) after > the > 'data.<type> <operator> <value>' > part, and we've kept that behavior. For forward compatibility, it would be > nice if we can introduce either additional 'haproxy -vv' info line, or CLI > command (e.g. 'show cli filters'), which would return the supported number > of filter entries. Don't you think that the extension of the syntax is the right opportunity to make this parser a bit stricter ? Otherwise you risk to expose it a bit more, with possibly more users adding undetected mistakes, which will make the enforcement harder later. Anyway I merged it as-is because it shouldn't be a showstopper to its merge, but if you think you can quickly add a bit more control, that would be welcome! > Error handling could also be improved (we don't show which filter entry is > wrong, if we have more than one), but I wanted to first check with you guys > if we can add "snprintf" style error function to the cli, in addition to > existing cli_dynerr()/cli_dynmsg() Usually what we do is that we call memprintf() and pass it to cli_dyn*() which then frees it. So you shouldn't need to add a new one. Thanks! Willy

