Fix positional args with new parser
- Better alignment for use of positional args without using an option. - Should work similarly with old parsing framework. - Change position where missing options are checked. - Fixes #701
This commit is contained in:
@@ -216,6 +216,7 @@ public class OptionTypeCommands {
|
||||
.withOption()
|
||||
.longNames("arg1")
|
||||
.type(String.class)
|
||||
.position(0)
|
||||
.required()
|
||||
.and()
|
||||
.withTarget()
|
||||
|
||||
@@ -36,6 +36,13 @@ class OptionTypeCommandsTests extends AbstractSampleTests {
|
||||
assertScreenContainsText(session, "Hello hi");
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@E2ESource(command = "option-type-string hi")
|
||||
void optionTypeStringPositional(String command, boolean interactive) {
|
||||
BaseShellSession<?> session = createSession(command, interactive);
|
||||
assertScreenContainsText(session, "Hello hi");
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@E2ESource(command = "option-type-boolean", reg = false)
|
||||
void optionTypeBooleanWithAnno(String command, boolean interactive) {
|
||||
|
||||
Reference in New Issue
Block a user