Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
a49af50a
Commit
a49af50a
authored
Nov 27, 2014
by
Peter van 't Hof
Browse files
added licence option
parent
f859d404
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetExecutable.scala
View file @
a49af50a
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment