diff --git a/bundles/org.dbvr.app.ce.test/src/org/dbvr/cli/app/ce/command/TestCommand.java b/bundles/org.dbvr.app.ce.test/src/org/dbvr/cli/app/ce/command/TestCommand.java index 06b5943..4e0eaf4 100644 --- a/bundles/org.dbvr.app.ce.test/src/org/dbvr/cli/app/ce/command/TestCommand.java +++ b/bundles/org.dbvr.app.ce.test/src/org/dbvr/cli/app/ce/command/TestCommand.java @@ -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"; @@ -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") diff --git a/test/org.dbvr.test.platform/src/org/dbvr/test/HelpArgTest.java b/test/org.dbvr.test.platform/src/org/dbvr/test/HelpArgTest.java index 54b963e..082ad70 100644 --- a/test/org.dbvr.test.platform/src/org/dbvr/test/HelpArgTest.java +++ b/test/org.dbvr.test.platform/src/org/dbvr/test/HelpArgTest.java @@ -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();