spring-shell icon indicating copy to clipboard operation
spring-shell copied to clipboard

Autocomplete ValueProvider is not invoked when argument have empty name

Open Antoniossss opened this issue 5 years ago • 0 comments
trafficstars

Using shell 2.0.0.RELEASE

My shell method looks like this

    @ShellMethod(key = "ctx instance", value = "Gets or sets currently selected instance")
    public void currentInstance(@ShellOption(value = {""}, valueProvider = MyProvider.class, defaultValue = ShellOption.NULL)
                                        MyInstance instance) {

Now the goal of empty name is to allow for following invocations to work

ctx instance ctx instance someValue

so the first variant is "read" and second is for writing.

However, in such configuration TAB does not invoke MyProvider provider. It works as expected if @ShellOption (value={"someParam"}) is given with an exception that argument must be named now.

Antoniossss avatar Apr 22 '20 13:04 Antoniossss