diff --git a/public/java/src/org/broadinstitute/sting/utils/help/GenericDocumentationHandler.java b/public/java/src/org/broadinstitute/sting/utils/help/GenericDocumentationHandler.java index 7ea77a939..b100b3e1b 100644 --- a/public/java/src/org/broadinstitute/sting/utils/help/GenericDocumentationHandler.java +++ b/public/java/src/org/broadinstitute/sting/utils/help/GenericDocumentationHandler.java @@ -432,11 +432,17 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler { * Returns a Pair of (main, synonym) names for argument with fullName s1 and * shortName s2. The main is selected to be the longest of the two, provided * it doesn't exceed MAX_DISPLAY_NAME, in which case the shorter is taken. - * @param s1 - * @param s2 - * @return + * + * @param s1 the short argument name without -, or null if not provided + * @param s2 the long argument name without --, or null if not provided + * @return A pair of fully qualified names (with - or --) for the argument. The first + * element is the primary display name while the second (potentially null) is a + * synonymous name. */ Pair displayNames(String s1, String s2) { + s1 = s1 == null ? null : "-" + s1; + s2 = s2 == null ? null : "--" + s2; + if ( s1 == null ) return new Pair(s2, null); if ( s2 == null ) return new Pair(s1, null); @@ -510,7 +516,7 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler { */ protected Map docForArgument(FieldDoc fieldDoc, ArgumentSource source, ArgumentDefinition def) { Map root = new HashMap(); - Pair names = displayNames("-" + def.shortName, "--" + def.fullName); + Pair names = displayNames(def.shortName, def.fullName); root.put("name", names.getFirst() );