spring-shell
spring-shell copied to clipboard
Support arg=value format with options
Hello,
I recently upgraded from spring-shell 2.7.5 to 3.2.0, and found that arguments of the form "arg=value" are no longer accepted.
Is this a regression, or was it intended?
Sample code:
@ShellMethod(
value = "Description",
key = {"test"})
public void test(
@ShellOption(
value = {"--foo", "-f"},
defaultValue = ShellOption.NULL) String foo) {
System.out.println("Foo is: " + foo);
}
shell:> test --foo=bar
Expected:
Foo is: bar
Actual:
Unrecognised option '--foo=bar'
Thanks for pointing this out. It wasn't implemented when parser infra went through complete overhaul.
I'm just thinking that when we add support for this should we be explicit which formats are supported, --arg value vs. --arg=value. It might be convenient to allow user to choose either or both.
Thanks for the response @jvalkeal . For me specially, this is not a blocking/urgent bug, but figured it was worth mentioning in case other users do the same migration