mirror of https://github.com/sbt/sbt.git
Merge pull request #4355 from eed3si9n/wip/one-letter
Allow single-letter aliases
This commit is contained in:
commit
3f1ae8bd55
|
|
@ -20,6 +20,10 @@ import sbt.internal.util.complete.{ DefaultParsers, Parser }
|
|||
import sbt.io.IO
|
||||
import sbt.librarymanagement.CrossVersion
|
||||
|
||||
/**
|
||||
* Cross implements the Scala cross building commands:
|
||||
* + ("cross") command and ++ ("switch") command.
|
||||
*/
|
||||
object Cross {
|
||||
|
||||
private[sbt] def spacedFirst(name: String) = opOrIDSpaced(name) ~ any.+
|
||||
|
|
@ -69,7 +73,7 @@ object Cross {
|
|||
token(CrossCommand <~ OptSpace) flatMap { _ =>
|
||||
(token(Parser.opt("-v" <~ Space)) ~ token(matched(state.combinedParser))).map {
|
||||
case (verbose, command) => CrossArgs(command, verbose.isDefined)
|
||||
} & spacedFirst(CrossCommand)
|
||||
}
|
||||
}
|
||||
|
||||
private def crossRestoreSessionParser: Parser[String] = token(CrossRestoreSessionCommand)
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
addCommandAlias("demo-success", "run true")
|
||||
addCommandAlias("demo-failure", "run false")
|
||||
addCommandAlias("z", "scalaVersion")
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
> demo-success
|
||||
-> demo-failure
|
||||
> +z
|
||||
> z
|
||||
|
|
|
|||
Loading…
Reference in New Issue