Skip to content
Snippets Groups Projects
Commit a33688d6 authored by bow's avatar bow
Browse files

Merge branch 'develop' into feature-wipereads

parents 1043a54f b37982ef
No related branches found
No related tags found
No related merge requests found
package nl.lumc.sasc.biopet.core
import java.util.Properties
object BiopetExecutable {
val modules: Map[String, List[MainCommand]] = Map(
......@@ -47,6 +49,9 @@ object BiopetExecutable {
|
|%s
|
|Subcommands:
| - version
|
|Questions or comments? Email sasc@lumc.nl or check out the project page at https://git.lumc.nl/biopet/biopet.git
""".stripMargin.format(modules.keys.mkString(","), getVersion, usage)
}
......@@ -69,6 +74,9 @@ object BiopetExecutable {
}
args match {
case Array("version") => {
println("version: " + getVersion)
}
case Array(module, name, passArgs @ _*) => {
getCommand(module, name).main(passArgs.toArray)
}
......@@ -84,6 +92,12 @@ object BiopetExecutable {
}
def getVersion = {
getClass.getPackage.getImplementationVersion
getClass.getPackage.getImplementationVersion + " (" + getCommitHash + ")"
}
def getCommitHash = {
val prop = new Properties()
prop.load(getClass.getClassLoader.getResourceAsStream("git.properties"))
prop.getProperty("git.commit.id.abbrev")
}
}
......@@ -274,14 +274,16 @@ class BiopetQCommandLine extends CommandLineProgram with Logging {
}
private def createQueueHeader(): Seq[String] = {
Seq(String.format("Queue v%s, Compiled %s", getQueueVersion, getBuildTimestamp),
"Copyright (c) 2012 The Broad Institute",
"For support and documentation go to http://www.broadinstitute.org/gatk")
Seq("Biopet version: " + BiopetExecutable.getVersion,"",
"Based on GATK Queue",
// String.format("Queue v%s, Compiled %s", getQueueVersion, getBuildTimestamp),
"Copyright (c) 2012 The Broad Institute",
"For support and documentation go to http://www.broadinstitute.org/gatk")
}
private def getQueueVersion: String = {
val stingResources: ResourceBundle = TextFormattingUtils.loadResourceBundle("StingText")
if (stingResources.containsKey("org.broadinstitute.sting.queue.QueueVersion.version")) {
stingResources.getString("org.broadinstitute.sting.queue.QueueVersion.version")
} else {
......
......@@ -30,9 +30,15 @@ trait ToolCommand extends MainCommand {
}
}
opt[Unit]('h', "help") foreach { _ =>
System.err.println(this.usage); sys.exit(1)} text("Print usage")
System.err.println(this.usage)
sys.exit(1)
} text("Print usage")
opt[Unit]('v', "version") foreach { _ =>
System.err.println("Version: " + BiopetExecutable.getVersion)
sys.exit(1)
} text("Print version")
}
type Args <: AbstractArgs
type OptParser <: AbstractOptParser
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment