mirror of https://github.com/sbt/sbt.git
Merge remote-tracking branch 'origin/0.13.7' into 0.13
This commit is contained in:
commit
ef6c5f7e55
|
|
@ -13,6 +13,8 @@ import BasicKeys._
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
import scala.util.control.NonFatal
|
||||||
|
|
||||||
object BasicCommands {
|
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
|
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) =
|
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 helpCommands = h.detail.keySet
|
||||||
val spacedArg = singleArgument(helpCommands).?
|
val spacedArg = singleArgument(helpCommands).?
|
||||||
applyEffect(spacedArg)(runHelp(s, h))
|
applyEffect(spacedArg)(runHelp(s, h))
|
||||||
|
|
@ -35,7 +40,12 @@ object BasicCommands {
|
||||||
|
|
||||||
def runHelp(s: State, h: Help)(arg: Option[String]): State =
|
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)
|
System.out.println(message)
|
||||||
s
|
s
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue