mirror of https://github.com/sbt/sbt.git
Cleanup commandProj
This commit is contained in:
parent
168d3aa267
commit
12d2b5a63b
|
|
@ -58,7 +58,7 @@ object BasicCommands {
|
|||
def completionsCommand = Command.make(CompletionsCommand, CompletionsBrief, CompletionsDetailed)(completionsParser)
|
||||
def completionsParser(state: State) =
|
||||
{
|
||||
val notQuoted = (NotQuoted ~ any.*) map { case (nq, s) => (nq +: s).mkString }
|
||||
val notQuoted = (NotQuoted ~ any.*) map { case (nq, s) => nq ++ s }
|
||||
val quotedOrUnquotedSingleArgument = Space ~> (StringVerbatim | StringEscapable | notQuoted)
|
||||
|
||||
applyEffect(token(quotedOrUnquotedSingleArgument ?? "" examples ("", " ")))(runCompletions(state))
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@ trait Watched {
|
|||
*/
|
||||
def pollInterval: Int = Watched.PollDelayMillis
|
||||
/** The message to show when triggered execution waits for sources to change.*/
|
||||
def watchingMessage(s: WatchState): String = Watched.defaultWatchingMessage(s)
|
||||
private[sbt] def watchingMessage(s: WatchState): String = Watched.defaultWatchingMessage(s)
|
||||
/** The message to show before an action is run. */
|
||||
def triggeredMessage(s: WatchState): String = Watched.defaultTriggeredMessage(s)
|
||||
private[sbt] def triggeredMessage(s: WatchState): String = Watched.defaultTriggeredMessage(s)
|
||||
}
|
||||
|
||||
object Watched {
|
||||
val defaultWatchingMessage: WatchState => String = _.count + ". Waiting for source changes... (press enter to interrupt)"
|
||||
val defaultTriggeredMessage: WatchState => String = const("")
|
||||
val clearWhenTriggered: WatchState => String = const(clearScreen)
|
||||
def clearScreen: String = "\033[2J\033[0;0H"
|
||||
def clearScreen: String = "\u001b[2J\u001b[0;0H"
|
||||
|
||||
private[this] class AWatched extends Watched
|
||||
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ object IPC {
|
|||
try { f(new IPC(s)) }
|
||||
finally { s.close() }
|
||||
|
||||
final class Server private[IPC] (s: ServerSocket) extends NotNull {
|
||||
final class Server private[IPC] (s: ServerSocket) {
|
||||
def port = s.getLocalPort
|
||||
def close() = s.close()
|
||||
def isClosed: Boolean = s.isClosed
|
||||
def connection[T](f: IPC => T): T = IPC.ipc(s.accept())(f)
|
||||
}
|
||||
}
|
||||
final class IPC private (s: Socket) extends NotNull {
|
||||
final class IPC private (s: Socket) {
|
||||
def port = s.getLocalPort
|
||||
private val in = new BufferedReader(new InputStreamReader(s.getInputStream))
|
||||
private val out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream))
|
||||
|
|
|
|||
Loading…
Reference in New Issue