mirror of https://github.com/sbt/sbt.git
Issue 1900, more robustness in help system
This commit is contained in:
parent
b6a2011734
commit
508fc1b5ec
|
|
@ -27,7 +27,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 ex: Throwable ⇒ Help.empty })
|
||||
}
|
||||
val helpCommands = h.detail.keySet
|
||||
val spacedArg = singleArgument(helpCommands).?
|
||||
applyEffect(spacedArg)(runHelp(s, h))
|
||||
|
|
@ -35,7 +38,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 ex: Throwable ⇒
|
||||
ex.toString
|
||||
}
|
||||
System.out.println(message)
|
||||
s
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue