allow running last from load failure prompt

This commit is contained in:
Mark Harrah 2011-07-24 17:36:42 -04:00
parent 2d4d27e529
commit f654b03618
1 changed files with 3 additions and 1 deletions

View File

@ -367,7 +367,7 @@ object BuiltinCommands
def loadFailed = Command.command(LoadFailed)(handleLoadFailed) def loadFailed = Command.command(LoadFailed)(handleLoadFailed)
@tailrec def handleLoadFailed(s: State): State = @tailrec def handleLoadFailed(s: State): State =
{ {
val result = (SimpleReader.readLine("Project loading failed: (r)etry, (q)uit, or (i)gnore? ") getOrElse Quit).toLowerCase val result = (SimpleReader.readLine("Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? ") getOrElse Quit).toLowerCase
def matches(s: String) = !result.isEmpty && (s startsWith result) def matches(s: String) = !result.isEmpty && (s startsWith result)
if(result.isEmpty || matches("retry")) if(result.isEmpty || matches("retry"))
@ -380,6 +380,8 @@ object BuiltinCommands
logger(s).warn("Ignoring load failure: " + (if(hadPrevious) "using previously loaded project." else "no project loaded.")) logger(s).warn("Ignoring load failure: " + (if(hadPrevious) "using previously loaded project." else "no project loaded."))
s s
} }
else if(matches("last"))
LastCommand :: LoadFailed :: s
else else
{ {
println("Invalid response.") println("Invalid response.")