Fix for GSA-90: GATK banner and error messages should point to the wiki website.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1226 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2009-07-13 21:56:41 +00:00
parent b18caa2052
commit 9f0fb9f3aa
3 changed files with 32 additions and 32 deletions

View File

@ -77,18 +77,8 @@ public abstract class CommandLineExecutable extends CommandLineProgram {
// set the analysis name in the argument collection
this.argCollection.analysisName = this.analysisName;
try {
GATKEngine.execute(argCollection, mWalker);
}
catch (ArgumentException ex) {
// Rethrow argument exceptions. Let the command-line argument do what it's designed to do.
throw ex;
}
catch (StingException exp) {
System.err.println("Caught StingException. It's message is " + exp.getMessage());
exp.printStackTrace();
return -1;
}
GATKEngine.execute(argCollection, mWalker);
return 0;
}

View File

@ -76,21 +76,25 @@ public class CommandLineGATK extends CommandLineProgram {
processArguments(argCollection);
this.argCollection.analysisName = this.analysisName;
try {
GATKEngine.execute(argCollection, mWalker);
}
catch (ArgumentException ex) {
// Rethrow argument exceptions. Let the command-line argument do what it's designed to do.
throw ex;
}
catch (StingException exp) {
System.err.println("Caught StingException. It's message is " + exp.getMessage());
exp.printStackTrace();
return -1;
}
GATKEngine.execute(argCollection, mWalker);
return 0;
}
/**
* Get pleasing info about the GATK.
* @return
*/
@Override
protected List<String> getApplicationHeader() {
List<String> header = new ArrayList<String>();
header.add("The Genome Analysis Toolkit (GATK)");
header.add("Copyright (c) 2009 The Broad Institute");
header.add("Please view our documentation at http://www.broadinstitute.org/gsa/wiki");
header.add("For support, email gsadevelopers@broadinstitute.org");
header.add("");
return header;
}
/**
* GATK can add arguments dynamically based on analysis type.
*
@ -144,7 +148,6 @@ public class CommandLineGATK extends CommandLineProgram {
};
}
/**
* Preprocess the arguments before submitting them to the GATK engine.
* @param argCollection Collection of arguments to preprocess.

View File

@ -9,6 +9,8 @@ import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.EnumSet;
import java.util.Enumeration;
import java.util.Collections;
import java.util.List;
/**
* User: aaron
@ -113,6 +115,14 @@ public abstract class CommandLineProgram {
return runningInstructions;
}
/**
* Allows a given application to return a few lines of text describing the application.
* @return A few lines of text describing the application. Should not be null.
*/
protected List<String> getApplicationHeader() {
return Collections.singletonList("Program Name: " + getClass().getName());
}
/**
* Will this application want to vary its argument list dynamically?
* If so, parse the command-line options and then prompt the subclass to return
@ -303,8 +313,8 @@ public abstract class CommandLineProgram {
java.util.Date date = new java.util.Date();
logger.info("-------------------------------------------------------");
logger.info("Program Name: " + clp.getClass().getName());
for( String headerLine: clp.getApplicationHeader() )
logger.info(headerLine);
String output = "";
for (String str : args) {
output = output + str + " ";
@ -354,11 +364,8 @@ public abstract class CommandLineProgram {
*/
private static void printExitSystemMsg(final String msg) {
System.out.printf("------------------------------------------------------------------------------------------%n");
System.out.printf("An error has occurred%n");
System.out.printf("Check your command line arguments for any typos or inconsistencies.%n");
System.out.printf("If you think it's because of a bug or a feature in GATK that should work, please report this to gsadevelopers@broad.mit.edu%n");
System.out.printf("%n");
System.out.printf("%s%n", msg);
System.out.printf("An error has occurred. Please check your command line arguments for any typos or inconsistencies.%n%n");
System.out.printf("For assistance, please email us at gsadevelopers@broad.mit.edu, or review our documentation at http://www.broadinstitute.org/gsa/wiki.%n");
}
/**