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

No way to hide `--` prefix

Open alienhunter3010 opened this issue 10 months ago • 0 comments
trafficstars

I would like to write a REPL application that works like mysql-client. Using

    @ShellMethod(value = "READ data from DB.", key={"select", "SELECT"})
    public String select(
            @ShellOption(arity = Integer.MAX_VALUE, valueProvider = TableNameValueProvider.class)
            String[] sql) {

it's easy acquire something like SELECT * FROM books. But my TableNameValueProvider class is triggered only if I write SELECT * FROM --sql [TAB] and works one time only:

> SELECT * FROM --sql books JOIN -
--help   -h

I tried also with @Command / @Option / @OptionValues and w/ the CommandRegistration.builder() too. But I have always the same behaviour. I think that an implicit (boolean) annotation attribute will be perfect to solve this issue.

alienhunter3010 avatar Jan 12 '25 22:01 alienhunter3010