Skip to content
GitLab
Menu
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
6ae13b07
Commit
6ae13b07
authored
Jul 23, 2015
by
Peter van 't Hof
Browse files
fix error handle
parent
5a853052
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/PipelineCommand.scala
View file @
6ae13b07
...
@@ -36,11 +36,12 @@ trait PipelineCommand extends MainCommand with GatkLogging {
...
@@ -36,11 +36,12 @@ trait PipelineCommand extends MainCommand with GatkLogging {
val
argsSize
=
args
.
length
val
argsSize
=
args
.
length
for
(
t
<-
0
until
argsSize
)
{
for
(
t
<-
0
until
argsSize
)
{
if
(
args
(
t
)
==
"-config"
||
args
(
t
)
==
"--config_file"
)
{
if
(
args
(
t
)
==
"-config"
||
args
(
t
)
==
"--config_file"
)
{
if
(
t
>=
argsSize
)
throw
new
IllegalStateException
(
"-config needs a value"
)
if
(
args
.
length
<=
(
t
+
1
)
)
throw
new
IllegalStateException
(
"-config needs a value
: <file>
"
)
Config
.
global
.
loadConfigFile
(
new
File
(
args
(
t
+
1
)))
Config
.
global
.
loadConfigFile
(
new
File
(
args
(
t
+
1
)))
}
}
if
(
args
(
t
)
==
"-cv"
||
args
(
t
)
==
"--config_value"
)
{
if
(
args
(
t
)
==
"-cv"
||
args
(
t
)
==
"--config_value"
)
{
if
(
args
.
length
<=
(
t
+
1
))
throw
new
IllegalStateException
(
"-cv needs a value: <'key=value' or 'path:path:key=value'>"
)
val
v
=
args
(
t
+
1
).
split
(
"="
)
val
v
=
args
(
t
+
1
).
split
(
"="
)
require
(
v
.
size
==
2
,
"Value should be formatted like 'key=value' or 'path:path:key=value'"
)
require
(
v
.
size
==
2
,
"Value should be formatted like 'key=value' or 'path:path:key=value'"
)
val
value
=
v
(
1
)
val
value
=
v
(
1
)
...
@@ -51,12 +52,13 @@ trait PipelineCommand extends MainCommand with GatkLogging {
...
@@ -51,12 +52,13 @@ trait PipelineCommand extends MainCommand with GatkLogging {
}
}
if
(
args
(
t
)
==
"--logging_level"
||
args
(
t
)
==
"-l"
)
{
if
(
args
(
t
)
==
"--logging_level"
||
args
(
t
)
==
"-l"
)
{
if
(
args
.
length
<=
(
t
+
1
))
throw
new
IllegalStateException
(
"--logging_level/-l needs a value: <debug/info/warn/error>"
)
args
(
t
+
1
).
toLowerCase
match
{
args
(
t
+
1
).
toLowerCase
match
{
case
"debug"
=>
Logging
.
logger
.
setLevel
(
org
.
apache
.
log4j
.
Level
.
DEBUG
)
case
"debug"
=>
Logging
.
logger
.
setLevel
(
org
.
apache
.
log4j
.
Level
.
DEBUG
)
case
"info"
=>
Logging
.
logger
.
setLevel
(
org
.
apache
.
log4j
.
Level
.
INFO
)
case
"info"
=>
Logging
.
logger
.
setLevel
(
org
.
apache
.
log4j
.
Level
.
INFO
)
case
"warn"
=>
Logging
.
logger
.
setLevel
(
org
.
apache
.
log4j
.
Level
.
WARN
)
case
"warn"
=>
Logging
.
logger
.
setLevel
(
org
.
apache
.
log4j
.
Level
.
WARN
)
case
"error"
=>
Logging
.
logger
.
setLevel
(
org
.
apache
.
log4j
.
Level
.
ERROR
)
case
"error"
=>
Logging
.
logger
.
setLevel
(
org
.
apache
.
log4j
.
Level
.
ERROR
)
case
_
=>
case
_
=>
throw
new
IllegalStateException
(
"--logging_level/-l needs a value: <debug/info/warn/error>"
)
}
}
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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