Skip to content

Question for Arity #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eubnara opened this issue Jan 11, 2023 · 3 comments
Closed

Question for Arity #611

eubnara opened this issue Jan 11, 2023 · 3 comments
Labels
type/bug Is a bug report

Comments

@eubnara
Copy link
Contributor

eubnara commented Jan 11, 2023

image
image

According to "current" document, it seems to take multiple values separated by spaces when specifying arity.
However, with version 2.1.4, it only takes multiple values if it is separated by comma.

Examples are gone on the 2.1.4 documentation. (https://docs.spring.io/spring-shell/docs/2.1.4/site/reference/htmlsingle/#using-shell-options-arity)

Is it expected behavior that it does not allow to get multiple values separated by spaces?
I guess this commit(7042d1f) impacts on this behavor.

image

@jvalkeal
Copy link
Contributor

Thanks pointing this out! Now that I tried it myself it's indeed caused not-so-great handling of position parameters vs. parsing option type, vs. type conversions.

We really need to revisit this area so that it works properly.

@jvalkeal
Copy link
Contributor

Issues #614 and #616 contains fixes and got backported to 2.1.x. There's also changes in docs.

This is in samples:

@ShellMethod(key = LEGACY_ANNO + "arity-float-array", group = GROUP)
public String testArityFloatArrayLegacyAnnotation(
@ShellOption(value = "--arg1", arity = 3) float[] arg1
) {
return "Hello " + floatsToString(arg1);
}

If you want to try then need to pick snapshots.

@jvalkeal
Copy link
Contributor

Closing as I think it's handled with previous commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Is a bug report
Projects
None yet
Development

No branches or pull requests

2 participants