Commit a49af50a authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

added licence option

parent f859d404
package nl.lumc.sasc.biopet.core
import java.util.Properties
import nl.lumc.sasc.biopet.core.BiopetExecutable._
import org.apache.log4j.Logger
import scala.io.Source
trait BiopetExecutable extends Logging {
......@@ -37,6 +39,7 @@ trait BiopetExecutable extends Logging {
|
|Subcommands:
| - version
| - license
|
|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)
......@@ -56,13 +59,16 @@ trait BiopetExecutable extends Logging {
System.err.println(s"ERROR: command '$name' does not exist in module '$module'\n" + usage(module))
System.exit(1)
}
return command.get
command.get
}
args match {
case Array("version") => {
println("version: " + getVersion)
}
case Array("license") => {
println(getLicense)
}
case Array(module, name, passArgs @ _*) => {
getCommand(module, name).main(passArgs.toArray)
}
......@@ -77,10 +83,6 @@ trait BiopetExecutable extends Logging {
}
}
def getVersion = BiopetExecutable.getVersion
def getCommitHash = BiopetExecutable.getCommitHash
def checkDirtyBuild(logger: Logger) {
val prop = new Properties()
prop.load(getClass.getClassLoader.getResourceAsStream("git.properties"))
......@@ -105,4 +107,9 @@ object BiopetExecutable {
prop.load(getClass.getClassLoader.getResourceAsStream("git.properties"))
prop.getProperty("git.commit.id.abbrev")
}
def getLicense: String = {
val stream = getClass.getClassLoader.getResourceAsStream("nl/lumc/sasc/biopet/License.txt")
Source.fromInputStream(stream).getLines().mkString("\n", "\n", "\n")
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment