mirror of https://github.com/sbt/sbt.git
make -client the same as --client
The problem was that -client was different from --client, which makes for a confusing user experience. So, this change makes them the same and re-names -client to --java-client. The value of this is that hopefully -client and --client being the same feels more logical to users.
This commit is contained in:
parent
3ef1c5508b
commit
f12b0baef0
|
|
@ -210,6 +210,7 @@ $AliasCommand name=
|
||||||
def Client: String = "client"
|
def Client: String = "client"
|
||||||
def ClientDetailed: String =
|
def ClientDetailed: String =
|
||||||
"Provides an interactive prompt from which commands can be run on a server."
|
"Provides an interactive prompt from which commands can be run on a server."
|
||||||
|
def JavaClient: String = "--java-client"
|
||||||
def DashClient: String = "-client"
|
def DashClient: String = "-client"
|
||||||
def DashDashClient: String = "--client"
|
def DashDashClient: String = "--client"
|
||||||
def DashDashDetachStdio: String = "--detach-stdio"
|
def DashDashDetachStdio: String = "--detach-stdio"
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import java.util.Properties
|
||||||
import java.util.concurrent.ForkJoinPool
|
import java.util.concurrent.ForkJoinPool
|
||||||
import java.util.concurrent.atomic.AtomicBoolean
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
|
|
||||||
import sbt.BasicCommandStrings.{ Shell, Shutdown, TemplateCommand }
|
import sbt.BasicCommandStrings.{ JavaClient, Shell, Shutdown, TemplateCommand }
|
||||||
import sbt.Project.LoadAction
|
import sbt.Project.LoadAction
|
||||||
import sbt.compiler.EvalImports
|
import sbt.compiler.EvalImports
|
||||||
import sbt.internal.Aggregation.AnyKeys
|
import sbt.internal.Aggregation.AnyKeys
|
||||||
|
|
@ -23,22 +23,22 @@ import sbt.internal.CommandStrings.BootCommand
|
||||||
import sbt.internal._
|
import sbt.internal._
|
||||||
import sbt.internal.client.BspClient
|
import sbt.internal.client.BspClient
|
||||||
import sbt.internal.inc.ScalaInstance
|
import sbt.internal.inc.ScalaInstance
|
||||||
|
import sbt.internal.io.Retry
|
||||||
import sbt.internal.nio.{ CheckBuildSources, FileTreeRepository }
|
import sbt.internal.nio.{ CheckBuildSources, FileTreeRepository }
|
||||||
import sbt.internal.server.{ BuildServerProtocol, NetworkChannel }
|
import sbt.internal.server.{ BuildServerProtocol, NetworkChannel }
|
||||||
import sbt.internal.util.Types.{ const, idFun }
|
import sbt.internal.util.Types.{ const, idFun }
|
||||||
import sbt.internal.util.{ Terminal => ITerminal, _ }
|
|
||||||
import sbt.internal.util.complete.{ Parser, SizeParser }
|
import sbt.internal.util.complete.{ Parser, SizeParser }
|
||||||
|
import sbt.internal.util.{ Terminal => ITerminal, _ }
|
||||||
import sbt.io._
|
import sbt.io._
|
||||||
import sbt.io.syntax._
|
import sbt.io.syntax._
|
||||||
import sbt.util.{ Level, Logger, Show }
|
import sbt.util.{ Level, Logger, Show }
|
||||||
|
import xsbti.AppProvider
|
||||||
import xsbti.compile.CompilerCache
|
import xsbti.compile.CompilerCache
|
||||||
|
|
||||||
import scala.annotation.{ nowarn, tailrec }
|
import scala.annotation.{ nowarn, tailrec }
|
||||||
import scala.concurrent.ExecutionContext
|
import scala.concurrent.ExecutionContext
|
||||||
import scala.concurrent.duration.Duration
|
import scala.concurrent.duration.Duration
|
||||||
import scala.util.control.NonFatal
|
import scala.util.control.NonFatal
|
||||||
import sbt.internal.io.Retry
|
|
||||||
import xsbti.AppProvider
|
|
||||||
|
|
||||||
/** This class is the entry point for sbt. */
|
/** This class is the entry point for sbt. */
|
||||||
final class xMain extends xsbti.AppMain {
|
final class xMain extends xsbti.AppMain {
|
||||||
|
|
@ -58,7 +58,7 @@ private[sbt] object xMain {
|
||||||
}
|
}
|
||||||
private[sbt] def run(configuration: xsbti.AppConfiguration): xsbti.MainResult = {
|
private[sbt] def run(configuration: xsbti.AppConfiguration): xsbti.MainResult = {
|
||||||
try {
|
try {
|
||||||
import BasicCommandStrings.{ DashClient, DashDashClient, DashDashServer, runEarly }
|
import BasicCommandStrings.{ DashDashClient, DashDashServer, runEarly }
|
||||||
import BasicCommands.early
|
import BasicCommands.early
|
||||||
import BuiltinCommands.defaults
|
import BuiltinCommands.defaults
|
||||||
import sbt.internal.CommandStrings.{ BootCommand, DefaultsCommand, InitCommand }
|
import sbt.internal.CommandStrings.{ BootCommand, DefaultsCommand, InitCommand }
|
||||||
|
|
@ -69,7 +69,7 @@ private[sbt] object xMain {
|
||||||
val userCommands = configuration.arguments
|
val userCommands = configuration.arguments
|
||||||
.map(_.trim)
|
.map(_.trim)
|
||||||
.filterNot(_ == DashDashServer)
|
.filterNot(_ == DashDashServer)
|
||||||
val isClient: String => Boolean = cmd => (cmd == DashClient) || (cmd == DashDashClient)
|
val isClient: String => Boolean = cmd => (cmd == JavaClient) || (cmd == DashDashClient)
|
||||||
val isBsp: String => Boolean = cmd => (cmd == "-bsp") || (cmd == "--bsp")
|
val isBsp: String => Boolean = cmd => (cmd == "-bsp") || (cmd == "--bsp")
|
||||||
val isServer = !userCommands.exists(c => isBsp(c) || isClient(c))
|
val isServer = !userCommands.exists(c => isBsp(c) || isClient(c))
|
||||||
val bootServerSocket = if (isServer) getSocketOrExit(configuration) match {
|
val bootServerSocket = if (isServer) getSocketOrExit(configuration) match {
|
||||||
|
|
|
||||||
2
sbt
2
sbt
|
|
@ -582,7 +582,7 @@ process_args () {
|
||||||
--numeric-version) print_sbt_version=1 && shift ;;
|
--numeric-version) print_sbt_version=1 && shift ;;
|
||||||
--script-version) print_sbt_script_version=1 && shift ;;
|
--script-version) print_sbt_script_version=1 && shift ;;
|
||||||
-d|-debug|--debug) sbt_debug=1 && addSbt "-debug" && shift ;;
|
-d|-debug|--debug) sbt_debug=1 && addSbt "-debug" && shift ;;
|
||||||
--client) use_sbtn=1 && shift ;;
|
-client|--client) use_sbtn=1 && shift ;;
|
||||||
--server) use_sbtn=0 && shift ;;
|
--server) use_sbtn=0 && shift ;;
|
||||||
|
|
||||||
-mem|--mem) require_arg integer "$1" "$2" && addMemory "$2" && shift 2 ;;
|
-mem|--mem) require_arg integer "$1" "$2" && addMemory "$2" && shift 2 ;;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue