https://espeasy.readthedocs.io/en/lates ... mmand.html ("Command a specific task for multiple instances of a plugin")
I found that multiple optional parameters seem not be supported properly and I wonder if that is bug or feature
The problem: If you have two optional parameters like "command,a,b" you get in the pluginfrom the function "parseString(...)":
Code: Select all
par1 = parseString(string, 2); par2 = parseString(string, 3);
command-string par1 par2
--------------------------------------
1) command,a,b a b
2) command,a a
3) command,,b b <=== !!!
4) command,b b
I had instead expected for 3)
!) command,,b b
and also the following delivers the same as 3)
5) command,,,,,b b
6) command, ,b b
and it is not possible to distinguish between 3) and 4) and also not 5).
With this implementation, it is in practice solely possible to have the very last parameter(s) optional, because multiple sequential separators are always treated as one.
The question is, if the current behaviour is a bug or a feature
The problem, I think, is in the following sequence of "bool GetArgvBeginEnd(...)" in "StringConverter.cpp"
Code: Select all
if (!parenthesis && (c == ' ') && (d == ' ')) {}
else if (!parenthesis && (c == ' ') && (d == separator)) {}
else if (!parenthesis && (c == separator) && (d == ' ')) {}
else if (!parenthesis && (c == ' ') && (d >= 33) && (d <= 126)) {}
else if (!parenthesis && (c == separator) && (d >= 33) && (d <= 126)) {}
else
{
I had expected there, in the if-clause, a "&& (d != separator)" or similar, which might solve the issue.