diff --git a/src/main/java/org/broadinstitute/barclay/help/DefaultDocWorkUnitHandler.java b/src/main/java/org/broadinstitute/barclay/help/DefaultDocWorkUnitHandler.java index 6ea45322..e7832d57 100644 --- a/src/main/java/org/broadinstitute/barclay/help/DefaultDocWorkUnitHandler.java +++ b/src/main/java/org/broadinstitute/barclay/help/DefaultDocWorkUnitHandler.java @@ -8,6 +8,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.broadinstitute.barclay.argparser.*; +import org.broadinstitute.barclay.utils.Utils; import java.lang.reflect.*; import java.util.*; @@ -471,7 +472,7 @@ protected void processPositionalArguments( argBindings.put("synonyms", "NA"); argBindings.put("exclusiveOf", "NA"); argBindings.put("type", argumentTypeString(positionalArgDef.getUnderlyingField().getGenericType())); - argBindings.put("options", Collections.EMPTY_LIST); + argBindings.put("options", getPossibleValues(positionalArgDef, "positional")); argBindings.put("attributes", "NA"); argBindings.put("required", "yes"); argBindings.put("minRecValue", "NA"); @@ -481,7 +482,7 @@ protected void processPositionalArguments( argBindings.put("defaultValue", "NA"); argBindings.put("minElements", positionalArgDef.getPositionalArgumentsAnnotation().minElements()); argBindings.put("maxElements", positionalArgDef.getPositionalArgumentsAnnotation().maxElements()); - + argBindings.put("collection", positionalArgDef.isCollection()); args.get("positional").add(argBindings); args.get("all").add(argBindings); } @@ -758,13 +759,10 @@ protected String processNamedArgument( String.join(", ", argDef.getMutexTargetList()) : "NA"); - // enum options - argBindings.put("options", - argDef.getUnderlyingField().getType().isEnum() ? - docForEnumArgument(argDef.getUnderlyingField().getType()) : - Collections.EMPTY_LIST); + // possible values + argBindings.put("options", getPossibleValues(argDef, argDef.getLongName())); - List attributes = new ArrayList<>(); + final List attributes = new ArrayList<>(); if (!argDef.isOptional()) { attributes.add("required"); } @@ -772,42 +770,89 @@ protected String processNamedArgument( attributes.add("deprecated"); } argBindings.put("attributes", attributes.size() > 0 ? String.join(", ", attributes) : "NA"); - + argBindings.put("collection", argDef.isCollection()); return kind; } + /** + * Return a (possibly empty) list of possible values that can be specified for this argument. Each + * value in the list is a map with "name" and "summary" keys. + * @param argDef {ArgumentDefinition} + * @return list of possible options for {@code argDef}. May be empty. May may not be null. + */ + private List> getPossibleValues(final ArgumentDefinition argDef, final String displayName) { + Utils.nonNull(argDef); + + final Field underlyingField = argDef.getUnderlyingField(); + Class targetClass = underlyingField.getType(); + + // enum options + if (argDef.isCollection() && underlyingField.getGenericType() instanceof ParameterizedType) { + // if this argument is a Collection (including an EnumSet), use the type of the generic type + // parameter as the target class, instead of the collection class itself + final Type typeParamType = underlyingField.getGenericType(); + final ParameterizedType pType = (ParameterizedType) typeParamType; + final Type genericTypes[] = pType.getActualTypeArguments(); + if (genericTypes.length != 1 || genericTypes[0] instanceof ParameterizedType) { + return Collections.emptyList(); + } + try { + targetClass = Class.forName(genericTypes[0].getTypeName()); + } catch (ClassNotFoundException e) { + throw new RuntimeException(String.format("No class found for type parameter (%s) used for argument (%s)", + genericTypes[0].getTypeName(), displayName), e); + } + } + + return targetClass.isEnum() ? + docForEnumArgument(targetClass) : + Collections.emptyList(); + } + /** * Helper routine that provides a FreeMarker map for an enumClass, grabbing the - * values of the enum and their associated javadoc documentation. + * values of the enum and their associated javadoc or {@link CommandLineArgumentParser.ClpEnum} documentation. * - * @param enumClass - * @return + * @param enumClass an enum Class that may optionally implement {@link CommandLineArgumentParser.ClpEnum} + * @return a List of maps with keys for "name" and "summary" for each of the class's possible enum constants */ - private List> docForEnumArgument(final Class enumClass) { + @SuppressWarnings("unchecked") + private > List> docForEnumArgument(final Class enumClass) { final ClassDoc doc = this.getDoclet().getClassDocForClass(enumClass); if ( doc == null ) { - throw new RuntimeException("Tried to get docs for enum " + enumClass + " but got null instead"); + throw new RuntimeException(String.format("Unable to get ClassDoc for enum %s", enumClass)); } - final Set enumConstantFieldNames = enumConstantsNames(enumClass); - final List> bindings = new ArrayList>(); - for (final FieldDoc fieldDoc : doc.fields(false)) { - if (enumConstantFieldNames.contains(fieldDoc.name()) ) { - bindings.add( - new HashMap() { - static final long serialVersionUID = 0L; - { - put("name", fieldDoc.name()); - put("summary", fieldDoc.commentText()); - } - } - ); + final List> bindings = new ArrayList<>(); + if (CommandLineArgumentParser.ClpEnum.class.isAssignableFrom(enumClass)) { + final T[] enumConstants = (T[]) enumClass.getEnumConstants(); + for ( final T enumConst : enumConstants ) { + bindings.add(createPossibleValuesMap( + enumConst.name(), + ((CommandLineArgumentParser.ClpEnum) enumConst).getHelpDoc())); + } + } else { + final Set enumConstantFieldNames = enumConstantsNames(enumClass); + for (final FieldDoc fieldDoc : doc.fields(false)) { + if (enumConstantFieldNames.contains(fieldDoc.name())) { + bindings.add(createPossibleValuesMap(fieldDoc.name(), fieldDoc.commentText())); + } } } return bindings; } + private HashMap createPossibleValuesMap(final String name, final String summary) { + return new HashMap() { + static final long serialVersionUID = 0L; + { + put("name", name); + put("summary", summary); + } + }; + } + /** * @return a non-null set of fields that are enum constants */ diff --git a/src/main/resources/org/broadinstitute/barclay/helpTemplates/generic.html.ftl b/src/main/resources/org/broadinstitute/barclay/helpTemplates/generic.html.ftl index 8126a7b8..64646c3c 100644 --- a/src/main/resources/org/broadinstitute/barclay/helpTemplates/generic.html.ftl +++ b/src/main/resources/org/broadinstitute/barclay/helpTemplates/generic.html.ftl @@ -45,7 +45,11 @@ <#if arg.options?has_content>

- The ${arg.name} argument is an enumerated type (${arg.type}), which can have one of the following values: + <#if arg.collection> + The ${arg.name} argument is an enumerated type (${arg.type}), which can accept the following values: + <#else> + The ${arg.name} argument is a list of an enumerated type (${arg.type}), which can accept one or more of the following values: +

<#list arg.options as option>
${option.name}
diff --git a/src/test/java/org/broadinstitute/barclay/help/testinputs/TestArgumentContainer.java b/src/test/java/org/broadinstitute/barclay/help/testinputs/TestArgumentContainer.java index f71d37c9..cf85dd68 100644 --- a/src/test/java/org/broadinstitute/barclay/help/testinputs/TestArgumentContainer.java +++ b/src/test/java/org/broadinstitute/barclay/help/testinputs/TestArgumentContainer.java @@ -193,6 +193,9 @@ public String getHelpDoc() { optional = false) TestEnum requiredClpEnum; + @Argument(fullName="enumCollection") + List enumCollection = new ArrayList<>(); + /** * Mutually exclusive args */ diff --git a/src/test/resources/org/broadinstitute/barclay/help/expected/BashTabCompletionDoclet/bashTabCompletionDocletTestLaunch-completion.sh b/src/test/resources/org/broadinstitute/barclay/help/expected/BashTabCompletionDoclet/bashTabCompletionDocletTestLaunch-completion.sh index 86514478..46f76b19 100644 --- a/src/test/resources/org/broadinstitute/barclay/help/expected/BashTabCompletionDoclet/bashTabCompletionDocletTestLaunch-completion.sh +++ b/src/test/resources/org/broadinstitute/barclay/help/expected/BashTabCompletionDoclet/bashTabCompletionDocletTestLaunch-completion.sh @@ -428,13 +428,13 @@ _bashTabCompletionDocletTestLaunch_masterCompletionFunction() NUM_POSITIONAL_ARGUMENTS=2 POSITIONAL_ARGUMENT_TYPE=("List[File]") DEPENDENT_ARGUMENTS=() - NORMAL_COMPLETION_ARGUMENTS=(--requiredClpEnum --requiredFileList --requiredInputFilesFromArgCollection --requiredStringInputFromArgCollection --requiredStringList --usesFieldNameForArgName --enumSetLong --fullAnonymousArgName --mutexSourceField --mutexTargetField1 --mutexTargetField2 --optionalClpEnum --optionalDouble --optionalDoubleList --optionalFileList --optionalFlag --optionalInputFilesFromArgCollection --optionalStringInputFromArgCollection --optionalStringList --testPlugin --advancedOptionalInt --deprecatedString ) + NORMAL_COMPLETION_ARGUMENTS=(--enumCollection --requiredClpEnum --requiredFileList --requiredInputFilesFromArgCollection --requiredStringInputFromArgCollection --requiredStringList --usesFieldNameForArgName --enumSetLong --fullAnonymousArgName --mutexSourceField --mutexTargetField1 --mutexTargetField2 --optionalClpEnum --optionalDouble --optionalDoubleList --optionalFileList --optionalFlag --optionalInputFilesFromArgCollection --optionalStringInputFromArgCollection --optionalStringList --testPlugin --advancedOptionalInt --deprecatedString ) MUTUALLY_EXCLUSIVE_ARGS=("--mutexSourceField;mutexTargetField1,mutexTargetField2" "--mutexTargetField1;mutexSourceField" "--mutexTargetField2;mutexSourceField" ) SYNONYMOUS_ARGS=("--requiredClpEnum;-requiredClpEnum" "--requiredFileList;-reqFilList" "--requiredInputFilesFromArgCollection;-rRequiredInputFilesFromArgCollection" "--requiredStringInputFromArgCollection;-requiredStringInputFromArgCollection" "--requiredStringList;-reqStrList" "--enumSetLong;-ES" "--fullAnonymousArgName;-anonymousClassArg" "--mutexSourceField;-mutexSourceField" "--mutexTargetField1;-mutexTargetField1" "--mutexTargetField2;-mutexTargetField2" "--optionalClpEnum;-optionalClpEnum" "--optionalDouble;-optDouble" "--optionalDoubleList;-optDoubleList" "--optionalFileList;-optFilList" "--optionalFlag;-optFlag" "--optionalInputFilesFromArgCollection;-optionalInputFilesFromArgCollection" "--optionalStringInputFromArgCollection;-optionalStringInputFromArgCollection" "--optionalStringList;-optStrList" "--advancedOptionalInt;-advancedOptInt" "--deprecatedString;-depStr" ) - MIN_OCCURRENCES=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) - MAX_OCCURRENCES=(2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 ) - ALL_LEGAL_ARGUMENTS=(--requiredClpEnum --requiredFileList --requiredInputFilesFromArgCollection --requiredStringInputFromArgCollection --requiredStringList --usesFieldNameForArgName --enumSetLong --fullAnonymousArgName --mutexSourceField --mutexTargetField1 --mutexTargetField2 --optionalClpEnum --optionalDouble --optionalDoubleList --optionalFileList --optionalFlag --optionalInputFilesFromArgCollection --optionalStringInputFromArgCollection --optionalStringList --testPlugin --advancedOptionalInt --deprecatedString ) - ALL_ARGUMENT_VALUE_TYPES=("TestEnum" "List[File]" "List[File]" "String" "List[String]" "String" "EnumSet[TestEnum]" "List[File]" "List[File]" "List[File]" "List[File]" "TestEnum" "double" "List[Double]" "List[File]" "boolean" "List[File]" "String" "List[String]" "List[String]" "int" "int" ) + MIN_OCCURRENCES=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) + MAX_OCCURRENCES=(2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 ) + ALL_LEGAL_ARGUMENTS=(--enumCollection --requiredClpEnum --requiredFileList --requiredInputFilesFromArgCollection --requiredStringInputFromArgCollection --requiredStringList --usesFieldNameForArgName --enumSetLong --fullAnonymousArgName --mutexSourceField --mutexTargetField1 --mutexTargetField2 --optionalClpEnum --optionalDouble --optionalDoubleList --optionalFileList --optionalFlag --optionalInputFilesFromArgCollection --optionalStringInputFromArgCollection --optionalStringList --testPlugin --advancedOptionalInt --deprecatedString ) + ALL_ARGUMENT_VALUE_TYPES=("List[TestEnum]" "TestEnum" "List[File]" "List[File]" "String" "List[String]" "String" "EnumSet[TestEnum]" "List[File]" "List[File]" "List[File]" "List[File]" "TestEnum" "double" "List[Double]" "List[File]" "boolean" "List[File]" "String" "List[String]" "List[String]" "int" "int" ) # Complete the arguments for this tool: _bashTabCompletionDocletTestLaunch_handleArgs diff --git a/src/test/resources/org/broadinstitute/barclay/help/expected/BashTabCompletionDoclet/bashTabCompletionDocletTestLaunchWithDefaults-completion.sh b/src/test/resources/org/broadinstitute/barclay/help/expected/BashTabCompletionDoclet/bashTabCompletionDocletTestLaunchWithDefaults-completion.sh index 3f6df27c..a7514496 100644 --- a/src/test/resources/org/broadinstitute/barclay/help/expected/BashTabCompletionDoclet/bashTabCompletionDocletTestLaunchWithDefaults-completion.sh +++ b/src/test/resources/org/broadinstitute/barclay/help/expected/BashTabCompletionDoclet/bashTabCompletionDocletTestLaunchWithDefaults-completion.sh @@ -428,13 +428,13 @@ _bashTabCompletionDocletTestLaunchWithDefaults_masterCompletionFunction() NUM_POSITIONAL_ARGUMENTS=2 POSITIONAL_ARGUMENT_TYPE=("List[File]") DEPENDENT_ARGUMENTS=() - NORMAL_COMPLETION_ARGUMENTS=(--requiredClpEnum --requiredFileList --requiredInputFilesFromArgCollection --requiredStringInputFromArgCollection --requiredStringList --usesFieldNameForArgName --enumSetLong --fullAnonymousArgName --mutexSourceField --mutexTargetField1 --mutexTargetField2 --optionalClpEnum --optionalDouble --optionalDoubleList --optionalFileList --optionalFlag --optionalInputFilesFromArgCollection --optionalStringInputFromArgCollection --optionalStringList --testPlugin --advancedOptionalInt --deprecatedString ) + NORMAL_COMPLETION_ARGUMENTS=(--enumCollection --requiredClpEnum --requiredFileList --requiredInputFilesFromArgCollection --requiredStringInputFromArgCollection --requiredStringList --usesFieldNameForArgName --enumSetLong --fullAnonymousArgName --mutexSourceField --mutexTargetField1 --mutexTargetField2 --optionalClpEnum --optionalDouble --optionalDoubleList --optionalFileList --optionalFlag --optionalInputFilesFromArgCollection --optionalStringInputFromArgCollection --optionalStringList --testPlugin --advancedOptionalInt --deprecatedString ) MUTUALLY_EXCLUSIVE_ARGS=("--mutexSourceField;mutexTargetField1,mutexTargetField2" "--mutexTargetField1;mutexSourceField" "--mutexTargetField2;mutexSourceField" ) SYNONYMOUS_ARGS=("--requiredClpEnum;-requiredClpEnum" "--requiredFileList;-reqFilList" "--requiredInputFilesFromArgCollection;-rRequiredInputFilesFromArgCollection" "--requiredStringInputFromArgCollection;-requiredStringInputFromArgCollection" "--requiredStringList;-reqStrList" "--enumSetLong;-ES" "--fullAnonymousArgName;-anonymousClassArg" "--mutexSourceField;-mutexSourceField" "--mutexTargetField1;-mutexTargetField1" "--mutexTargetField2;-mutexTargetField2" "--optionalClpEnum;-optionalClpEnum" "--optionalDouble;-optDouble" "--optionalDoubleList;-optDoubleList" "--optionalFileList;-optFilList" "--optionalFlag;-optFlag" "--optionalInputFilesFromArgCollection;-optionalInputFilesFromArgCollection" "--optionalStringInputFromArgCollection;-optionalStringInputFromArgCollection" "--optionalStringList;-optStrList" "--advancedOptionalInt;-advancedOptInt" "--deprecatedString;-depStr" ) - MIN_OCCURRENCES=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) - MAX_OCCURRENCES=(2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 ) - ALL_LEGAL_ARGUMENTS=(--requiredClpEnum --requiredFileList --requiredInputFilesFromArgCollection --requiredStringInputFromArgCollection --requiredStringList --usesFieldNameForArgName --enumSetLong --fullAnonymousArgName --mutexSourceField --mutexTargetField1 --mutexTargetField2 --optionalClpEnum --optionalDouble --optionalDoubleList --optionalFileList --optionalFlag --optionalInputFilesFromArgCollection --optionalStringInputFromArgCollection --optionalStringList --testPlugin --advancedOptionalInt --deprecatedString ) - ALL_ARGUMENT_VALUE_TYPES=("TestEnum" "List[File]" "List[File]" "String" "List[String]" "String" "EnumSet[TestEnum]" "List[File]" "List[File]" "List[File]" "List[File]" "TestEnum" "double" "List[Double]" "List[File]" "boolean" "List[File]" "String" "List[String]" "List[String]" "int" "int" ) + MIN_OCCURRENCES=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) + MAX_OCCURRENCES=(2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 2147483647 ) + ALL_LEGAL_ARGUMENTS=(--enumCollection --requiredClpEnum --requiredFileList --requiredInputFilesFromArgCollection --requiredStringInputFromArgCollection --requiredStringList --usesFieldNameForArgName --enumSetLong --fullAnonymousArgName --mutexSourceField --mutexTargetField1 --mutexTargetField2 --optionalClpEnum --optionalDouble --optionalDoubleList --optionalFileList --optionalFlag --optionalInputFilesFromArgCollection --optionalStringInputFromArgCollection --optionalStringList --testPlugin --advancedOptionalInt --deprecatedString ) + ALL_ARGUMENT_VALUE_TYPES=("List[TestEnum]" "TestEnum" "List[File]" "List[File]" "String" "List[String]" "String" "EnumSet[TestEnum]" "List[File]" "List[File]" "List[File]" "List[File]" "TestEnum" "double" "List[Double]" "List[File]" "boolean" "List[File]" "String" "List[String]" "List[String]" "int" "int" ) # Complete the arguments for this tool: _bashTabCompletionDocletTestLaunchWithDefaults_handleArgs diff --git a/src/test/resources/org/broadinstitute/barclay/help/expected/HelpDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.html b/src/test/resources/org/broadinstitute/barclay/help/expected/HelpDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.html index 91367235..129e4373 100644 --- a/src/test/resources/org/broadinstitute/barclay/help/expected/HelpDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.html +++ b/src/test/resources/org/broadinstitute/barclay/help/expected/HelpDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.html @@ -109,6 +109,13 @@

TestArgumentContainer specific arguments

Required Arguments + + --enumCollection
+ + + [] + Undocumented option + --requiredClpEnum
@@ -331,6 +338,28 @@

--deprecatedString  ∞ ] ]


+

--enumCollection + +

+

+ Undocumented option
+ +

+

+ The --enumCollection argument is an enumerated type (List[TestEnum]), which can accept the following values: +

+
ENUM_VALUE_1
+
This is enum value 1.
+
ENUM_VALUE_2
+
This is enum value 2.
+
+

+

+ R + List[TestEnum] +  [] +

+

--enumSetLong / -ES

@@ -338,6 +367,15 @@

--enumSetLong Some set thing.

+

+ The --enumSetLong argument is an enumerated type (EnumSet[TestEnum]), which can accept the following values: +

+
ENUM_VALUE_1
+
This is enum value 1.
+
ENUM_VALUE_2
+
This is enum value 2.
+
+

EnumSet[TestEnum]  [ENUM_VALUE_1] @@ -402,12 +440,12 @@

--optionalClpEnum

- The --optionalClpEnum argument is an enumerated type (TestEnum), which can have one of the following values: + The --optionalClpEnum argument is a list of an enumerated type (TestEnum), which can accept one or more of the following values:

ENUM_VALUE_1
-
+
This is enum value 1.
ENUM_VALUE_2
-
+
This is enum value 2.

@@ -509,12 +547,12 @@

--requiredClpEnum

- The --requiredClpEnum argument is an enumerated type (TestEnum), which can have one of the following values: + The --requiredClpEnum argument is a list of an enumerated type (TestEnum), which can accept one or more of the following values:

ENUM_VALUE_1
-
+
This is enum value 1.
ENUM_VALUE_2
-
+
This is enum value 2.

diff --git a/src/test/resources/org/broadinstitute/barclay/help/expected/HelpDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json b/src/test/resources/org/broadinstitute/barclay/help/expected/HelpDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json index b5a159d8..5ee39689 100644 --- a/src/test/resources/org/broadinstitute/barclay/help/expected/HelpDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json +++ b/src/test/resources/org/broadinstitute/barclay/help/expected/HelpDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json @@ -46,6 +46,30 @@ "kind": "deprecated", "options": [] }, + { + "summary": "Undocumented option", + "name": "--enumCollection", + "synonyms": "NA", + "type": "List[TestEnum]", + "required": "yes", + "fulltext": "", + "defaultValue": "[]", + "minValue": "NA", + "maxValue": "NA", + "minRecValue": "NA", + "maxRecValue": "NA", + "kind": "required", + "options": [ + { + "summary": "This is enum value 1.", + "name": "ENUM_VALUE_1" + }, + { + "summary": "This is enum value 2.", + "name": "ENUM_VALUE_2" + } + ] + }, { "summary": "Some set thing.", "name": "--enumSetLong", @@ -59,7 +83,16 @@ "minRecValue": "NA", "maxRecValue": "NA", "kind": "optional", - "options": [] + "options": [ + { + "summary": "This is enum value 1.", + "name": "ENUM_VALUE_1" + }, + { + "summary": "This is enum value 2.", + "name": "ENUM_VALUE_2" + } + ] }, { "summary": "Test anonymous class arg", @@ -136,11 +169,11 @@ "kind": "optional", "options": [ { - "summary": "", + "summary": "This is enum value 1.", "name": "ENUM_VALUE_1" }, { - "summary": "", + "summary": "This is enum value 2.", "name": "ENUM_VALUE_2" } ] @@ -265,11 +298,11 @@ "kind": "required", "options": [ { - "summary": "", + "summary": "This is enum value 1.", "name": "ENUM_VALUE_1" }, { - "summary": "", + "summary": "This is enum value 2.", "name": "ENUM_VALUE_2" } ] diff --git a/src/test/resources/org/broadinstitute/barclay/help/expected/TestDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.html b/src/test/resources/org/broadinstitute/barclay/help/expected/TestDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.html index e4ee9338..dbdfc505 100644 --- a/src/test/resources/org/broadinstitute/barclay/help/expected/TestDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.html +++ b/src/test/resources/org/broadinstitute/barclay/help/expected/TestDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.html @@ -121,6 +121,13 @@

TestArgumentContainer specific arguments

Required Arguments + + --enumCollection
+ + + [] + Undocumented option + --requiredClpEnum
@@ -343,6 +350,28 @@

--deprecatedString  ∞ ] ]


+

--enumCollection + +

+

+ Undocumented option
+ +

+

+ The --enumCollection argument is an enumerated type (List[TestEnum]), which can have one of the following values: +

+
ENUM_VALUE_1
+
This is enum value 1.
+
ENUM_VALUE_2
+
This is enum value 2.
+
+

+

+ R + List[TestEnum] +  [] +

+

--enumSetLong / -ES

@@ -350,6 +379,15 @@

--enumSetLong Some set thing.

+

+ The --enumSetLong argument is an enumerated type (EnumSet[TestEnum]), which can have one of the following values: +

+
ENUM_VALUE_1
+
This is enum value 1.
+
ENUM_VALUE_2
+
This is enum value 2.
+
+

EnumSet[TestEnum]  [ENUM_VALUE_1] @@ -417,9 +455,9 @@

--optionalClpEnum The --optionalClpEnum argument is an enumerated type (TestEnum), which can have one of the following values:
ENUM_VALUE_1
-
+
This is enum value 1.
ENUM_VALUE_2
-
+
This is enum value 2.

@@ -524,9 +562,9 @@

--requiredClpEnum The --requiredClpEnum argument is an enumerated type (TestEnum), which can have one of the following values:
ENUM_VALUE_1
-
+
This is enum value 1.
ENUM_VALUE_2
-
+
This is enum value 2.

diff --git a/src/test/resources/org/broadinstitute/barclay/help/expected/TestDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json b/src/test/resources/org/broadinstitute/barclay/help/expected/TestDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json index dff122dd..3906b20c 100644 --- a/src/test/resources/org/broadinstitute/barclay/help/expected/TestDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json +++ b/src/test/resources/org/broadinstitute/barclay/help/expected/TestDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json @@ -46,6 +46,30 @@ "kind": "deprecated", "options": [] }, + { + "summary": "Undocumented option", + "name": "--enumCollection", + "synonyms": "NA", + "type": "List[TestEnum]", + "required": "yes", + "fulltext": "", + "defaultValue": "[]", + "minValue": "NA", + "maxValue": "NA", + "minRecValue": "NA", + "maxRecValue": "NA", + "kind": "required", + "options": [ + { + "summary": "This is enum value 1.", + "name": "ENUM_VALUE_1" + }, + { + "summary": "This is enum value 2.", + "name": "ENUM_VALUE_2" + } + ] + }, { "summary": "Some set thing.", "name": "--enumSetLong", @@ -59,7 +83,16 @@ "minRecValue": "NA", "maxRecValue": "NA", "kind": "optional", - "options": [] + "options": [ + { + "summary": "This is enum value 1.", + "name": "ENUM_VALUE_1" + }, + { + "summary": "This is enum value 2.", + "name": "ENUM_VALUE_2" + } + ] }, { "summary": "Test anonymous class arg", @@ -136,11 +169,11 @@ "kind": "optional", "options": [ { - "summary": "", + "summary": "This is enum value 1.", "name": "ENUM_VALUE_1" }, { - "summary": "", + "summary": "This is enum value 2.", "name": "ENUM_VALUE_2" } ] @@ -265,11 +298,11 @@ "kind": "required", "options": [ { - "summary": "", + "summary": "This is enum value 1.", "name": "ENUM_VALUE_1" }, { - "summary": "", + "summary": "This is enum value 2.", "name": "ENUM_VALUE_2" } ] diff --git a/src/test/resources/org/broadinstitute/barclay/help/expected/WDLDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json b/src/test/resources/org/broadinstitute/barclay/help/expected/WDLDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json index 7dcbd111..9dd19279 100644 --- a/src/test/resources/org/broadinstitute/barclay/help/expected/WDLDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json +++ b/src/test/resources/org/broadinstitute/barclay/help/expected/WDLDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.json @@ -9,6 +9,7 @@ "TestArgumentContainer.positionalArgs": "Array[File]", + "TestArgumentContainer.enumCollection": "Array[String]", "TestArgumentContainer.requiredClpEnum": "String", "TestArgumentContainer.companionDictionary": "Array[String]", "TestArgumentContainer.companionIndex": "Array[String]", diff --git a/src/test/resources/org/broadinstitute/barclay/help/expected/WDLDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.wdl b/src/test/resources/org/broadinstitute/barclay/help/expected/WDLDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.wdl index fd76420c..b09207ce 100644 --- a/src/test/resources/org/broadinstitute/barclay/help/expected/WDLDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.wdl +++ b/src/test/resources/org/broadinstitute/barclay/help/expected/WDLDoclet/org_broadinstitute_barclay_help_testinputs_TestArgumentContainer.wdl @@ -17,6 +17,7 @@ version 1.0 # positionalArgs Positional arguments, min = 2, max = 2 # # Required Tool Arguments +# enumCollection Undocumented option # requiredClpEnum Required Clp enum # requiredFileList Required file list # companionDictionary Companion resource for requiredFileList @@ -65,6 +66,7 @@ workflow TestArgumentContainer { Array[File] positionalArgs # Required Arguments + Array[String] enumCollection String requiredClpEnum Array[String] requiredFileList Array[String] companionDictionary @@ -116,6 +118,7 @@ workflow TestArgumentContainer { positionalArgs = positionalArgs, # Required Arguments + enumCollection = enumCollection, requiredClpEnum = requiredClpEnum, requiredFileList = requiredFileList, companionDictionary = companionDictionary, @@ -201,6 +204,7 @@ task TestArgumentContainer { String preemptibleRequirements String bootdisksizegbRequirements Array[File] positionalArgs + Array[String] enumCollection String requiredClpEnum Array[String] requiredFileList Array[String] companionDictionary @@ -229,6 +233,7 @@ task TestArgumentContainer { command <<< ~{appLocation} TestArgumentContainer \ ~{sep=' ' positionalArgs} \ + --enumCollection ~{sep=' --enumCollection ' enumCollection} \ --requiredClpEnum ~{sep=' --requiredClpEnum ' requiredClpEnum} \ --requiredFileList ~{sep=' --requiredFileList ' requiredFileList} \ --requiredInputFilesFromArgCollection ~{sep=' --requiredInputFilesFromArgCollection ' requiredInputFilesFromArgCollection} \