Merge remote-tracking branch 'origin/0.13.7' into 0.13

This commit is contained in:
David Perez 2015-03-25 16:01:15 +01:00
commit ef6c5f7e55
1 changed files with 12 additions and 2 deletions

View File

@ -13,6 +13,8 @@ import BasicKeys._
import java.io.File
import scala.util.control.NonFatal
object BasicCommands {
lazy val allBasicCommands = Seq(nop, ignore, help, completionsCommand, multi, ifLast, append, setOnFailure, clearOnFailure, stashOnFailure, popOnFailure, reboot, call, early, exit, continuous, history, shell, read, alias) ++ compatCommands
@ -27,7 +29,10 @@ object BasicCommands {
def helpParser(s: State) =
{
val h = (Help.empty /: s.definedCommands)(_ ++ _.help(s))
val h = (Help.empty /: s.definedCommands) { (a, b) =>
a ++
(try b.help(s) catch { case NonFatal(ex) => Help.empty })
}
val helpCommands = h.detail.keySet
val spacedArg = singleArgument(helpCommands).?
applyEffect(spacedArg)(runHelp(s, h))
@ -35,7 +40,12 @@ object BasicCommands {
def runHelp(s: State, h: Help)(arg: Option[String]): State =
{
val message = Help.message(h, arg)
val message = try
Help.message(h, arg)
catch {
case NonFatal(ex) =>
ex.toString
}
System.out.println(message)
s
}