Commit 10c474fa authored by bow's avatar bow
Browse files

Update retrieveCommand function

parent 1de25c35
......@@ -75,12 +75,11 @@ object BiopetExecutable {
System.exit(1)
}
def retrieveCommand(q: String, cl: List[MainCommand]): Option[MainCommand] = {
for (mc <- cl) {
if (q == mc.name.toLowerCase)
return Some(mc)
}
None
def retrieveCommand(q: String, cl: List[MainCommand]): Option[MainCommand] =
cl match {
case head :: tail if head.name.toLowerCase == q => Some(head)
case Nil => None
case head :: tail => retrieveCommand(q, tail)
}
args match {
......
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