Print out the current version number in the application header.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2633 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
9e0ae993c7
commit
8dafd26100
|
|
@ -75,7 +75,7 @@
|
|||
<arg value="--no-newline"/>
|
||||
</exec>
|
||||
<tstamp>
|
||||
<format property="build.timestamp" pattern="dd MMMM yyyy hh:mm aa"/>
|
||||
<format property="build.timestamp" pattern="yyyy/MM/dd HH:mm:ss"/>
|
||||
</tstamp>
|
||||
|
||||
<echo message="Compiling module: ${target}"/>
|
||||
|
|
|
|||
|
|
@ -99,12 +99,16 @@ public class CommandLineGATK extends CommandLineExecutable {
|
|||
* @return The application header.
|
||||
*/
|
||||
public static List<String> createApplicationHeader() {
|
||||
ResourceBundle headerInfo = ResourceBundle.getBundle("StingText");
|
||||
|
||||
String versionNumber = headerInfo.getString("org.broadinstitute.sting.gatk.version");
|
||||
String timestamp = headerInfo.getString("build.timestamp");
|
||||
|
||||
List<String> header = new ArrayList<String>();
|
||||
header.add("The Genome Analysis Toolkit (GATK)");
|
||||
header.add(String.format("The Genome Analysis Toolkit (GATK) v%s, Compiled %s",versionNumber,timestamp));
|
||||
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 gsahelp@broadinstitute.org");
|
||||
header.add("");
|
||||
return header;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package org.broadinstitute.sting.utils.help;
|
|||
import org.broadinstitute.sting.utils.cmdLine.ArgumentDefinition;
|
||||
import org.broadinstitute.sting.utils.cmdLine.ArgumentDefinitionGroup;
|
||||
import org.broadinstitute.sting.utils.cmdLine.ArgumentDefinitions;
|
||||
import org.broadinstitute.sting.utils.cmdLine.CommandLineProgram;
|
||||
import org.broadinstitute.sting.utils.TextFormattingUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
@ -46,6 +45,14 @@ public class HelpFormatter {
|
|||
public void printHelp( ApplicationDetails applicationDetails, ArgumentDefinitions argumentDefinitions ) {
|
||||
List<ArgumentDefinitionGroup> argumentGroups = prepareArgumentGroups( argumentDefinitions );
|
||||
|
||||
List<String> header = applicationDetails.applicationHeader;
|
||||
String barrier = createBarrier(header);
|
||||
|
||||
System.out.printf("%s%n",barrier);
|
||||
for(String headerLine: header)
|
||||
System.out.printf("%s%n",headerLine);
|
||||
System.out.printf("%s%n",barrier);
|
||||
|
||||
String synopsis = getSynopsis(applicationDetails.runningInstructions,argumentGroups);
|
||||
String additionalDetails = applicationDetails.additionalHelp != null ? applicationDetails.additionalHelp : "";
|
||||
String detailedDescription = getDetailed(argumentGroups);
|
||||
|
|
@ -234,7 +241,9 @@ public class HelpFormatter {
|
|||
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
java.util.Date date = new java.util.Date();
|
||||
|
||||
logger.info("-------------------------------------------------------");
|
||||
String barrier = createBarrier(applicationDetails.applicationHeader);
|
||||
|
||||
logger.info(barrier);
|
||||
for (String headerLine : applicationDetails.applicationHeader)
|
||||
logger.info(headerLine);
|
||||
String output = "";
|
||||
|
|
@ -243,6 +252,18 @@ public class HelpFormatter {
|
|||
}
|
||||
logger.info("Program Args: " + output);
|
||||
logger.info("Date/Time: " + dateFormat.format(date));
|
||||
logger.info("-------------------------------------------------------");
|
||||
logger.info(barrier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a barrier to use to distinguish the header from the rest of the output.
|
||||
* @param text A collection of lines to output as part of a header.
|
||||
* @return A barrier consisting of the '-' character.
|
||||
*/
|
||||
private static String createBarrier(List<String> text) {
|
||||
int barrierWidth = 0;
|
||||
for(String headerLine: text)
|
||||
barrierWidth = Math.max(headerLine.length(),barrierWidth);
|
||||
return String.format("%0" + barrierWidth + "d",0).replace('0','-');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue