@@ -47,6 +47,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
|
||||
/**
|
||||
* Tests for the {@link Help} command.
|
||||
*
|
||||
@@ -133,7 +135,8 @@ public class HelpTest {
|
||||
// Multiple keys and arity 0. Help displayed on next line
|
||||
@ShellOption(help = "Do not ask for confirmation. YOLO", arity = 0, value = {"-f", "--force"}) boolean force,
|
||||
// Single key, arity >= 1. Help displayed on next line. Optional
|
||||
@ShellOption(help = "The answer to everything", defaultValue = "42", value = "-n") int n,
|
||||
// Also, bears bean validation annotation
|
||||
@ShellOption(help = "The answer to everything", defaultValue = "42", value = "-n") @Max(5) int n,
|
||||
// Single key, arity > 1.
|
||||
@ShellOption(help = "Some other parameters", arity = 3, value = "-o") float[] o
|
||||
) {
|
||||
|
||||
@@ -1,23 +1,28 @@
|
||||
&
|
||||
&
|
||||
NAME&
|
||||
first-command - A rather extensive description of some command.&
|
||||
&
|
||||
SYNOPSYS&
|
||||
first-command [-r] [-f] [[-n] int] [-o] float float float &
|
||||
&
|
||||
OPTIONS&
|
||||
-r Whether to delete recursively [Optional, default = false]&
|
||||
&
|
||||
-f or --force&
|
||||
Do not ask for confirmation. YOLO [Optional, default = false]&
|
||||
&
|
||||
-n int&
|
||||
The answer to everything [Optional, default = 42]&
|
||||
&
|
||||
-o float float float&
|
||||
Some other parameters [Mandatory]&
|
||||
&
|
||||
ALSO KNOWN AS&
|
||||
1st-command&
|
||||
&
|
||||
|
||||
|
||||
NAME
|
||||
first-command - A rather extensive description of some command.
|
||||
|
||||
SYNOPSYS
|
||||
first-command [-r] [-f] [[-n] int] [-o] float float float
|
||||
|
||||
OPTIONS
|
||||
-r Whether to delete recursively
|
||||
[Optional, default = false]
|
||||
|
||||
-f or --force
|
||||
Do not ask for confirmation. YOLO
|
||||
[Optional, default = false]
|
||||
|
||||
-n int
|
||||
The answer to everything
|
||||
[Optional, default = 42]
|
||||
[must be less than or equal to 5]
|
||||
|
||||
-o float float float
|
||||
Some other parameters
|
||||
[Mandatory]
|
||||
|
||||
ALSO KNOWN AS
|
||||
1st-command
|
||||
|
||||
|
||||
Reference in New Issue
Block a user