Commit 9c612125 authored by bow's avatar bow
Browse files

Add explicit system exit points in main jar

parent e725e48b
...@@ -81,24 +81,32 @@ object BiopetExecutable { ...@@ -81,24 +81,32 @@ object BiopetExecutable {
args match { args match {
case Array("pipeline", pipelineName, pipelineArgs @ _*) => case Array("pipeline", pipelineName, pipelineArgs @ _*) =>
if (pipelines.contains(pipelineName)) if (pipelines.contains(pipelineName))
if (pipelineArgs.isEmpty) if (pipelineArgs.isEmpty) {
pipelines(pipelineName).main(Array("--help")) pipelines(pipelineName).main(Array("--help"))
else System.exit(1)
}
else {
pipelines(pipelineName).main(pipelineArgs.toArray) pipelines(pipelineName).main(pipelineArgs.toArray)
else System.exit(0)
}
else {
System.err.println(s"ERROR: pipeline '$pipelineName' does not exist") System.err.println(s"ERROR: pipeline '$pipelineName' does not exist")
System.err.println(pipelineUsage) System.err.println(pipelineUsage)
System.exit(1) System.exit(1)
}
case Array("pipeline") => case Array("pipeline") =>
System.err.println(pipelineUsage) System.err.println(pipelineUsage)
System.exit(1) System.exit(1)
case Array("tool", toolName, toolArgs @ _*) => case Array("tool", toolName, toolArgs @ _*) =>
if (tools.contains(toolName)) if (tools.contains(toolName)) {
tools(toolName).main(toolArgs.toArray) tools(toolName).main(toolArgs.toArray)
else System.exit(0)
}
else {
System.err.println(s"ERROR: tool '$toolName' does not exist") System.err.println(s"ERROR: tool '$toolName' does not exist")
System.err.println(toolUsage) System.err.println(toolUsage)
System.exit(1) System.exit(1)
}
case Array("tool") => case Array("tool") =>
System.err.println(toolUsage) System.err.println(toolUsage)
System.exit(1) System.exit(1)
......
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