From 74b8055b6ad3fccac0c3f27a02a42b5901d0740f Mon Sep 17 00:00:00 2001 From: hanna Date: Thu, 10 Dec 2009 16:43:06 +0000 Subject: [PATCH] Only show extra walker help if the user didn't specify a walker or specified an invalid walker. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2309 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/CommandLineGATK.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java b/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java index 71d7ab733..f7ffbe41f 100755 --- a/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java +++ b/java/src/org/broadinstitute/sting/gatk/CommandLineGATK.java @@ -109,24 +109,35 @@ public class CommandLineGATK extends CommandLineExecutable { /** * Retrieves additional information about GATK walkers. - * TODO: This functionality is very similar to that employed by the HelpFormatter. Generalize * the code in HelpFormatter and supply it as a helper to this method. * * @return A string summarizing the walkers available in this distribution. */ private String getAdditionalHelp() { + String additionalHelp = ""; - //HelpFormatter.LINE_WIDTH; + // If no analysis name is present, fill in extra help on the walkers. + String analysisName = getAnalysisName(); + if(analysisName == null || !GATKEngine.getWalkerManager().exists(getAnalysisName())) + additionalHelp = getWalkerHelp(); + return additionalHelp; + } + + /** + * Load in additional help information about all available walkers. + * @return A string representation of the additional help. + */ + private String getWalkerHelp() { final int PACKAGE_INDENT = 1; final int WALKER_INDENT = 3; - final String FIELD_SEPARATOR = " | "; + final String FIELD_SEPARATOR = " "; // Construct a help string to output available walkers. StringBuilder additionalHelp = new StringBuilder(); Formatter formatter = new Formatter(additionalHelp); - formatter.format("Available analyses:%n%n"); + formatter.format("Available analyses:%n"); // Get the list of walker names from the walker manager. WalkerManager walkerManager = GATKEngine.getWalkerManager();