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
Copy file name to clipboardExpand all lines: spring-shell-core/src/main/java/org/springframework/shell/core/command/adapter/MethodInvokerCommandAdapter.java
Copy file name to clipboardExpand all lines: spring-shell-core/src/test/java/org/springframework/shell/core/command/adapter/MethodInvokerCommandAdapterDefaultValueTests.java
Copy file name to clipboardExpand all lines: spring-shell-docs/modules/ROOT/pages/commands/syntax.adoc
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,22 @@ Options are named, while arguments are positional. Options can have short names
17
17
18
18
Options can be validated using the Bean Validation API by adding validation annotations to the method parameters, see the xref:commands/validation.adoc[Validating Command Options] section for more details.
19
19
20
+
Multi-valued arguments can be defined by using the `@Arguments` annotation on an array or a collection type (e.g., `List`, `Set`) as the method parameter type. In this case, all the remaining command line tokens will be collected into the collection:
The `@Arguments` annotation provides an attribute called `arity` that allows you to specify the number of arguments to be collected into the collection.
28
+
By default, the arity is not bound, which means that all remaining tokens will be collected. If you set the arity to a specific number, only that many tokens will be collected, and the rest will be treated as separate arguments or options.
29
+
Here is an example of using the `arity` attribute:
0 commit comments