mirror of https://github.com/sbt/sbt.git
Add help for 'show' command. Fixes #236.
This commit is contained in:
parent
2fcbaaf4fa
commit
078b72ee48
|
|
@ -10,6 +10,7 @@ package sbt
|
||||||
import DefaultParsers._
|
import DefaultParsers._
|
||||||
import Types.idFun
|
import Types.idFun
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
|
import CommandSupport.ShowCommand
|
||||||
|
|
||||||
object Act
|
object Act
|
||||||
{
|
{
|
||||||
|
|
@ -153,7 +154,7 @@ object Act
|
||||||
scopedKeyParser(extracted) flatMap Aggregation.valueParser(state, structure, show)
|
scopedKeyParser(extracted) flatMap Aggregation.valueParser(state, structure, show)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
def showParser = token( ("show" ~ Space) ^^^ true) ?? false
|
def showParser = token( (ShowCommand ~ Space) ^^^ true) ?? false
|
||||||
def scopedKeyParser(state: State): Parser[ScopedKey[_]] = scopedKeyParser(Project extract state)
|
def scopedKeyParser(state: State): Parser[ScopedKey[_]] = scopedKeyParser(Project extract state)
|
||||||
def scopedKeyParser(extracted: Extracted): Parser[ScopedKey[_]] =
|
def scopedKeyParser(extracted: Extracted): Parser[ScopedKey[_]] =
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ object CommandSupport
|
||||||
val TasksCommand = "tasks"
|
val TasksCommand = "tasks"
|
||||||
val ProjectCommand = "project"
|
val ProjectCommand = "project"
|
||||||
val ProjectsCommand = "projects"
|
val ProjectsCommand = "projects"
|
||||||
|
val ShowCommand = "show"
|
||||||
|
|
||||||
val Exit = "exit"
|
val Exit = "exit"
|
||||||
val Quit = "quit"
|
val Quit = "quit"
|
||||||
|
|
@ -49,6 +50,17 @@ EvalCommand + """ <expression>
|
||||||
Evaluates the given Scala expression and prints the result and type.
|
Evaluates the given Scala expression and prints the result and type.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def actHelp = Help(ShowCommand, (ShowCommand + " <key>", actBrief), actDetailed)
|
||||||
|
def actBrief = "Displays the result of evaluating the setting or task associated with 'key'."
|
||||||
|
def actDetailed =
|
||||||
|
ShowCommand + """ <setting>
|
||||||
|
|
||||||
|
Displays the value of the specified setting.
|
||||||
|
|
||||||
|
""" + ShowCommand + """ <task>
|
||||||
|
|
||||||
|
Evaluates the specified task and display the value returned by the task."""
|
||||||
|
|
||||||
val LastCommand = "last"
|
val LastCommand = "last"
|
||||||
val LastGrepCommand = "last-grep"
|
val LastGrepCommand = "last-grep"
|
||||||
|
|
||||||
|
|
@ -109,7 +121,7 @@ SetCommand + """ <setting-expression>
|
||||||
/** The command name to terminate the program.*/
|
/** The command name to terminate the program.*/
|
||||||
val TerminateAction: String = Exit
|
val TerminateAction: String = Exit
|
||||||
|
|
||||||
def continuousBriefHelp = (ContinuousExecutePrefix + " <action>", "Executes the specified command whenever source files change.")
|
def continuousBriefHelp = (ContinuousExecutePrefix + " <command>", "Executes the specified command whenever source files change.")
|
||||||
|
|
||||||
def tasksPreamble = """
|
def tasksPreamble = """
|
||||||
This is a list of tasks defined for the current project.
|
This is a list of tasks defined for the current project.
|
||||||
|
|
|
||||||
|
|
@ -391,7 +391,7 @@ object BuiltinCommands
|
||||||
for(id <- build.defined.keys.toSeq.sorted) log.info("\t" + prefix(id) + id)
|
for(id <- build.defined.keys.toSeq.sorted) log.info("\t" + prefix(id) + id)
|
||||||
}
|
}
|
||||||
|
|
||||||
def act = Command.custom(Act.actParser)
|
def act = Command.custom(Act.actParser, actHelp :: Nil)
|
||||||
|
|
||||||
def projects = Command.command(ProjectsCommand, projectsBrief, projectsDetailed ) { s =>
|
def projects = Command.command(ProjectsCommand, projectsBrief, projectsDetailed ) { s =>
|
||||||
val extracted = Project extract s
|
val extracted = Project extract s
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue