From 9bb0aac7bfed83c62eedaeef38a959a48b54ce0e Mon Sep 17 00:00:00 2001 From: Geraldine Van der Auwera Date: Fri, 16 Aug 2013 12:09:09 -0400 Subject: [PATCH] Disabled the help system's printout of cmdline options when GATK errors out. Now the user has to explicitly ask for it using -h. --- .../sting/commandline/CommandLineProgram.java | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java b/public/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java index cf11bb61c..f00bd0ad6 100644 --- a/public/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java +++ b/public/java/src/org/broadinstitute/sting/commandline/CommandLineProgram.java @@ -246,7 +246,7 @@ public abstract class CommandLineProgram { } } catch (ArgumentException e) { - clp.parser.printHelp(clp.getApplicationDetails()); + //clp.parser.printHelp(clp.getApplicationDetails()); // Rethrow the exception to exit with an error. throw e; } @@ -370,8 +370,8 @@ public abstract class CommandLineProgram { errorPrintf("------------------------------------------------------------------------------------------%n"); errorPrintf("A GATK RUNTIME ERROR has occurred (version %s):%n", CommandLineGATK.getVersionNumber()); errorPrintf("%n"); - errorPrintf("Please check the documentation guide to see if this is a known problem%n"); - errorPrintf("If not, please post the error, with stack trace, to the GATK forum%n"); + errorPrintf("This might be a bug. Please check the documentation guide to see if this is a known problem.%n"); + errorPrintf("If not, please post the error message, with stack trace, to the GATK forum.%n"); printDocumentationReference(); if ( msg == null ) // some exceptions don't have detailed messages msg = "Code exception (see stack trace for error itself)"; @@ -387,12 +387,17 @@ public abstract class CommandLineProgram { errorPrintf("------------------------------------------------------------------------------------------%n"); errorPrintf("A USER ERROR has occurred (version %s): %n", CommandLineGATK.getVersionNumber()); - errorPrintf("The invalid arguments or inputs must be corrected before the GATK can proceed%n"); - errorPrintf("Please do not post this error to the GATK forum%n"); errorPrintf("%n"); - errorPrintf("See the documentation (rerun with -h) for this tool to view allowable command-line arguments.%n"); + errorPrintf("This means that one or more arguments or inputs in your command are incorrect.%n"); + errorPrintf("The error message below tells you what is the problem.%n"); + errorPrintf("%n"); + errorPrintf("If the problem is an invalid argument, please check the online documentation guide%n"); + errorPrintf("(or rerun your command with --help) to view allowable command-line arguments for this tool.%n"); + errorPrintf("%n"); printDocumentationReference(); errorPrintf("%n"); + errorPrintf("Please do NOT post this error to the GATK forum unless you have really tried to fix it yourself.%n"); + errorPrintf("%n"); errorPrintf("MESSAGE: %s%n", e.getMessage().trim()); errorPrintf("------------------------------------------------------------------------------------------%n"); System.exit(1); @@ -404,14 +409,17 @@ public abstract class CommandLineProgram { errorPrintf("------------------------------------------------------------------------------------------%n"); errorPrintf("A BAM ERROR has occurred (version %s): %n", CommandLineGATK.getVersionNumber()); - errorPrintf("The invalid inputs must be corrected before the GATK can proceed%n"); - errorPrintf("Please do not post this error to the GATK forum until you have followed the instructions below%n"); errorPrintf("%n"); - errorPrintf("Please make sure that your BAM file is well-formed by running Picard's validator on it%n"); - errorPrintf("(see http://picard.sourceforge.net/command-line-overview.shtml#ValidateSamFile for details)%n"); - errorPrintf("Also, please ensure that your BAM index is not corrupted: delete the current one and regenerate it with 'samtools index'%n"); + errorPrintf("This means that there is something wrong with the BAM file(s) you provided.%n"); + errorPrintf("The error message below tells you what is the problem.%n"); + errorPrintf("%n"); printDocumentationReference(); errorPrintf("%n"); + errorPrintf("Please do NOT post this error to the GATK forum until you have followed these instructions:%n"); + errorPrintf("- Make sure that your BAM file is well-formed by running Picard's validator on it%n"); + errorPrintf("(see http://picard.sourceforge.net/command-line-overview.shtml#ValidateSamFile for details)%n"); + errorPrintf("- Ensure that your BAM index is not corrupted: delete the current one and regenerate it with 'samtools index'%n"); + errorPrintf("%n"); errorPrintf("MESSAGE: %s%n", t.getMessage().trim()); errorPrintf("------------------------------------------------------------------------------------------%n"); System.exit(1);