Closed fabiocarvalho777 closed 4 years ago
Hello,
I would like to work on this issue.
I am assuming the following scenario-
-pkey1=value1;key2=value2
should return key1 = value1
and key2 = value2
-pkey1=value\;1;key2=value\;2
should return key1 = value;1
and key2 = value;2
-pkey1=value\=1;key2=value\=2
should return key1 = value=1
and key2 = value=2
Please let me know if I am getting it right.
Hello @badalsarkar Yes, you got it right. Thanks!
Hi @fabiocarvalho777
I have figured out a solution. Changing
try (StringReader stringReader = new StringReader(inlineProperties.replace(';', '\n'))) {
in this file to
try (StringReader stringReader = new StringReader(inlineProperties.replaceAll("(?<!\\\\);", "\n"))) {
should produce the desired result.
But how do I go about testing it? Should I add new test and in which file?
Thanks.
@badalsarkar please, add a unit test class named ButterflyCliRunnerTest
here and add your tests there.
Thanks!!
@badalsarkar I have just merged your PR. Thank you very much for your contribution :-)
@fabiocarvalho777 , it was great to contribute. Thank you.
See issue #167 for context. Currently any semicolon passed to Butterfly CLI using
-p
will always be used to separate properties. Similarly, equals will always be used to separate property name from property value.However, both should also be allowed as property value, as long as escaped when using
-p
.