Fix parser for new command

This commit is contained in:
Eugene Yokota 2016-08-22 11:29:35 -04:00
parent 954e744408
commit f29932e594
1 changed files with 6 additions and 2 deletions

View File

@ -72,13 +72,17 @@ object BasicCommands {
def templateCommand = Command.make(TemplateCommand, templateBrief, templateDetailed)(templateCommandParser)
def templateCommandParser(state: State) =
{
val p = token(Space).* ~> repsep(StringBasic, token(Space))
val p = (token(Space) ~> repsep(StringBasic, token(Space))) | (token(EOF) map { case _ => Nil })
val trs = (state get templateResolvers) match {
case Some(trs) => trs.toList
case None => Nil
}
applyEffect(p)({ inputArg =>
val arguments = inputArg.toList ++ state.remainingCommands
val arguments = inputArg.toList ++
(state.remainingCommands.toList match {
case "shell" :: Nil => Nil
case xs => xs
})
trs find { tr =>
tr.isDefined(arguments.toArray)
} match {