Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support for String valueSeparator #13
I need to split the "apple:fruit::jasmine:?" as "apple:fruit" and "jasmine:?". So, in this case the value separator needs to be "::" a string. I was able to do that sometime back, don't exactly remember the version and I unfortunately lost the code as it was just a POC. But right now, there is nothing to provide String as a value separator even thought it internally uses String.
It looks as though your intended option arguments are SAT-style analogies "X is to Y as Z is to W".
One possibility would be to configure the parser like so:
where Analogy is your own "value type" (one-arg String ctor or public static valueOf(String) method); Analogy could then take on the responsibility for parsing the value.
On the other hand, ArgumentAcceptingOptionSpec.withValuesSeparatedBy() could be overloaded to accept a String separator rather than a char separator. It isn't this way now because no one had asked about it and I couldn't imagine wanting it.
Let me know your preference.