Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #380 from broadinstitute/gg_gatkdocs_arglabels

More detailed labels for arguments in the gakdocs
  • Loading branch information...
commit ee5de8510d584486d307d34d8c8e67eff47f957b 2 parents 6cda283 + 80ed186
@droazen droazen authored
View
16 public/java/src/org/broadinstitute/sting/commandline/ArgumentSource.java
@@ -160,6 +160,22 @@ public boolean isAdvanced() {
}
/**
+ * Is the given argument an output.
+ * @return True if so. False otherwise.
+ */
+ public boolean isOutput() {
+ return field.isAnnotationPresent(Output.class);
+ }
+
+ /**
+ * Is the given argument an input.
+ * @return True if so. False otherwise.
+ */
+ public boolean isInput() {
+ return field.isAnnotationPresent(Input.class);
+ }
+
+ /**
* Is this command-line argument dependent on some primitive argument types?
* @return True if this command-line argument depends on other arguments; false otherwise.
*/
View
42 public/java/src/org/broadinstitute/sting/utils/help/GenericDocumentationHandler.java
@@ -194,11 +194,26 @@ protected void addArgumentBindings(Map<String, Object> root) {
@Requires("argumentSource != null")
@Ensures("result != null")
private String docKindOfArg(ArgumentSource argumentSource) {
- if (argumentSource.isRequired()) return "required";
- else if (argumentSource.isAdvanced()) return "advanced";
+ if (argumentSource.isRequired()) {
+ if (argumentSource.isInput()) return "required_in";
+ else if (argumentSource.isOutput()) return "required_out";
+ else if (argumentSource.isFlag()) return "required_flag";
+ else return "required_param";
+ }
+ else if (argumentSource.isAdvanced()) {
+ if (argumentSource.isInput()) return "advanced_in";
+ else if (argumentSource.isOutput()) return "advanced_out";
+ else if (argumentSource.isFlag()) return "advanced_flag";
+ else return "advanced_param";
+ }
else if (argumentSource.isHidden()) return "hidden";
- else if (argumentSource.isDeprecated()) return "depreciated";
- else return "optional";
+ else if (argumentSource.isDeprecated()) return "deprecated";
+ else {
+ if (argumentSource.isInput()) return "optional_in";
+ else if (argumentSource.isOutput()) return "optional_out";
+ else if (argumentSource.isFlag()) return "optional_flag";
+ else return "optional_param";
+ }
}
/**
@@ -238,11 +253,20 @@ private Object argumentValue(Class c, ArgumentSource argumentSource) {
private Map<String, List<Map<String, Object>>> createArgumentMap() {
Map<String, List<Map<String, Object>>> args = new HashMap<String, List<Map<String, Object>>>();
args.put("all", new ArrayList<Map<String, Object>>());
- args.put("required", new ArrayList<Map<String, Object>>());
- args.put("optional", new ArrayList<Map<String, Object>>());
- args.put("advanced", new ArrayList<Map<String, Object>>());
+ args.put("required_in", new ArrayList<Map<String, Object>>());
+ args.put("required_out", new ArrayList<Map<String, Object>>());
+ args.put("required_param", new ArrayList<Map<String, Object>>());
+ args.put("required_flag", new ArrayList<Map<String, Object>>());
+ args.put("optional_in", new ArrayList<Map<String, Object>>());
+ args.put("optional_out", new ArrayList<Map<String, Object>>());
+ args.put("optional_param", new ArrayList<Map<String, Object>>());
+ args.put("optional_flag", new ArrayList<Map<String, Object>>());
+ args.put("advanced_in", new ArrayList<Map<String, Object>>());
+ args.put("advanced_out", new ArrayList<Map<String, Object>>());
+ args.put("advanced_param", new ArrayList<Map<String, Object>>());
+ args.put("advanced_flag", new ArrayList<Map<String, Object>>());
args.put("hidden", new ArrayList<Map<String, Object>>());
- args.put("depreciated", new ArrayList<Map<String, Object>>());
+ args.put("deprecated", new ArrayList<Map<String, Object>>());
return args;
}
@@ -843,7 +867,7 @@ protected String argumentTypeString(Type type) {
// general attributes
List<String> attributes = new ArrayList<String>();
if (def.required) attributes.add("required");
- if (source.isDeprecated()) attributes.add("depreciated");
+ if (source.isDeprecated()) attributes.add("deprecated");
if (attributes.size() > 0)
root.put("attributes", Utils.join(", ", attributes));
View
17 settings/helpTemplates/generic.template.html
@@ -235,11 +235,20 @@
</tr>
</thead>
<tbody>
- <@argumentlist name="Required" myargs=arguments.required/>
- <@argumentlist name="Optional" myargs=arguments.optional/>
- <@argumentlist name="Advanced" myargs=arguments.advanced/>
+ <@argumentlist name="Required Inputs" myargs=arguments.required_in/>
+ <@argumentlist name="Required Outputs" myargs=arguments.required_out/>
+ <@argumentlist name="Required Parameters" myargs=arguments.required_param/>
+ <@argumentlist name="Required Flags" myargs=arguments.required_flag/>
+ <@argumentlist name="Optional Inputs" myargs=arguments.optional_in/>
+ <@argumentlist name="Optional Outputs" myargs=arguments.optional_out/>
+ <@argumentlist name="Optional Parameters" myargs=arguments.optional_param/>
+ <@argumentlist name="Optional Flags" myargs=arguments.optional_flag/>
+ <@argumentlist name="Advanced Inputs" myargs=arguments.advanced_in/>
+ <@argumentlist name="Advanced Outputs" myargs=arguments.advanced_out/>
+ <@argumentlist name="Advanced Parameters" myargs=arguments.advanced_param/>
+ <@argumentlist name="Advanced Flags" myargs=arguments.advanced_flag/>
<@argumentlist name="Hidden" myargs=arguments.hidden/>
- <@argumentlist name="Depreciated" myargs=arguments.depreciated/>
+ <@argumentlist name="Deprecated" myargs=arguments.deprecated/>
</tbody>
</table>
</#if>
Please sign in to comment.
Something went wrong with that request. Please try again.