You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that after upgrading from 2.0.0-M3 to 2.1.3, parsing of method options failed for options annotated with @ShellOption if its value does not start with a leading -.
2022-11-24 18:33:54.638 INFO 246172 --- [ main] c.e.s.ShelloptionReproApplication : Starting ShelloptionReproApplication using Java 17.0.5 on ...
2022-11-24 18:33:54.641 INFO 246172 --- [ main] c.e.s.ShelloptionReproApplication : No active profile set, falling back to 1 default profile: "default"
2022-11-24 18:33:55.014 WARN 246172 --- [ main] org.jline : Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
2022-11-24 18:33:55.079 WARN 246172 --- [ main] org.jline : The Parser of class org.springframework.shell.jline.ExtendedDefaultParser does not support the CompletingParsedLine interface. Completion with escaped or quoted words won't work correctly.
2022-11-24 18:33:55.113 INFO 246172 --- [ main] c.e.s.ShelloptionReproApplication : Started ShelloptionReproApplication in 0.732 seconds (JVM running for 0.985)
This worked in 2.0.0-M3 and is still demonstrated in the docs as a way to define option names if one doesn't want to use the parameter name:
The text was updated successfully, but these errors were encountered:
jvalkeal
changed the title
ShellMethod parameters marked with @ShellOption do not get registered as options and parsed if the annotation value does not start with "-"
ShellOption not registered without hyphens
Nov 25, 2022
- While option should be defined i.e. using "--arg", discover
prefix from ShellMethod#prefix and use that if just "arg"
is defined.
- Backport #575
- Fixes#577
Uh oh!
There was an error while loading. Please reload this page.
I have noticed that after upgrading from 2.0.0-M3 to 2.1.3, parsing of method options failed for options annotated with
@ShellOption
if its value does not start with a leading-
.✔️ Case 1: No ShellOption annotation
Code:
Shell input / output:
✔️ Case 2: ShellOption annotation with leading
--
Code:
Shell input / output:
✔️ Case 3: ShellOption annotation with leading
-
and single character nameCode:
Shell input / output:
❌ Case 4: ShellOption annotation without leading
-
/--
and long nameCode:
Shell input / output:
Application log, no warnings given:
This worked in 2.0.0-M3 and is still demonstrated in the docs as a way to define option names if one doesn't want to use the parameter name:
spring-shell/spring-shell-docs/src/test/java/org/springframework/shell/docs/OptionSnippets.java
Lines 25 to 29 in 331df77
The text was updated successfully, but these errors were encountered: