Legacy Annotation

具有参数的目标方法会自动使用匹配的参数名称进行注册。

Unresolved include directive in modules/ROOT/pages/options/basics/legacyannotation.adoc - include::../../../../../src/test/java/org/springframework/shell/docs/OptionSnippets.java[]

如果您不希望它与参数名称相同,则可以使用 @ShellOption 注解来定义选项名称。

Unresolved include directive in modules/ROOT/pages/options/basics/legacyannotation.adoc - include::../../../../../src/test/java/org/springframework/shell/docs/OptionSnippets.java[]

如果未定义选项名称的前缀,即 ---,它将从 ShellMethod#prefix 中被识别。

Unresolved include directive in modules/ROOT/pages/options/basics/legacyannotation.adoc - include::../../../../../src/test/java/org/springframework/shell/docs/OptionSnippets.java[]