Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class TestCommand extends CLIAbstractSubcommand {
public static final String TEST_DOUBLE = "--test-double";
public static final String TEST_REQ_FIRST = "--test-req-first";
public static final String TEST_REQ_IN_MIDDLE = "--test-req-middle";
public static final String TEST_ONLY_SHORT_NAME = "-w";


public static final String EXAMPLE_COMMAND1 = TEST_COMMAND_NAME + " " + TEST_DOUBLE + "12.00";
public static final String EXAMPLE_COMMAND2 = TEST_COMMAND_NAME + " " + TEST_PARAM_NAME_NOT_REQ + "ASDASD";
Expand All @@ -64,6 +66,9 @@ public class TestCommand extends CLIAbstractSubcommand {
@CommandLine.Option(names = {TEST_DOUBLE}, description = "A double")
private Double doubleValue;

@CommandLine.Option(names = {TEST_ONLY_SHORT_NAME}, description = "A short name command")
private boolean commandWithoutLongName;


//must be sorted to the top in help
@CommandLine.Option(names = {TEST_REQ_IN_MIDDLE}, required = true, description = "Req param in the middle")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public void testHelpFormatAndOptionsOrder() throws Exception {
Assert.assertTrue(findOptionLine(allArgsByLine, TestCommand.TEST_INT_LIST).contains("(integer[])"));
Assert.assertTrue(findOptionLine(allArgsByLine, TestCommand.TEST_DOUBLE).contains("(double)"));
Assert.assertTrue(findOptionLine(allArgsByLine, TestCommand.TEST_STRING_LIST).contains("(string[])"));
Assert.assertTrue(findOptionLine(allArgsByLine, TestCommand.TEST_ONLY_SHORT_NAME).contains("(boolean)"));


String example1 = allArgsByLine[allArgsByLine.length - 2].trim();
Expand Down
Loading