diff options
author | Teemu Lehtinen <teemu.t.lehtinen@aalto.fi> | 2014-08-20 13:20:41 +0300 |
---|---|---|
committer | Teemu Lehtinen <teemu.t.lehtinen@aalto.fi> | 2014-10-13 23:50:29 +0300 |
commit | 7daecd8eacdc293f9113d4749f46e874d8eee01b (patch) | |
tree | 0d4529b1bc32c3baec8e3538c688557f5b50cb0e /src/compiler/scala/tools/nsc/settings/FscSettings.scala | |
parent | 8d25e84c9123fe9784ec9844b5184aa1b697b429 (diff) | |
download | scala-7daecd8eacdc293f9113d4749f46e874d8eee01b.tar.gz scala-7daecd8eacdc293f9113d4749f46e874d8eee01b.tar.bz2 scala-7daecd8eacdc293f9113d4749f46e874d8eee01b.zip |
Add option -port to fsc
Option "port" limits compile server lookup and start to given port.
Normally fsc will start a compile server in a random port if no server
is yet running. This can be problematic with firewalls and/or remote
compile servers. Option "port" should not be confused with option
"server" which looks for a compile server in given host and port and
fails if such server is not found.
Automatic tests for command line user interface do not exist at all.
Thus, adding a test for one new option would require designing a whole
new testing method.
Diffstat (limited to 'src/compiler/scala/tools/nsc/settings/FscSettings.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/FscSettings.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/FscSettings.scala b/src/compiler/scala/tools/nsc/settings/FscSettings.scala index 8c2b510bfd..fffbb4333f 100644 --- a/src/compiler/scala/tools/nsc/settings/FscSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/FscSettings.scala @@ -22,13 +22,15 @@ class FscSettings(error: String => Unit) extends Settings(error) { val reset = BooleanSetting("-reset", "Reset compile server caches") val shutdown = BooleanSetting("-shutdown", "Shutdown compile server") val server = StringSetting ("-server", "hostname:portnumber", "Specify compile server socket", "") + val port = IntSetting ("-port", "Search and start compile server in given port only", + 0, Some((0, Int.MaxValue)), (_: String) => None) val preferIPv4 = BooleanSetting("-ipv4", "Use IPv4 rather than IPv6 for the server socket") val idleMins = IntSetting ("-max-idle", "Set idle timeout in minutes for fsc (use 0 for no timeout)", 30, Some((0, Int.MaxValue)), (_: String) => None) // For improved help output, separating fsc options from the others. def fscSpecific = Set[Settings#Setting]( - currentDir, reset, shutdown, server, preferIPv4, idleMins + currentDir, reset, shutdown, server, port, preferIPv4, idleMins ) val isFscSpecific: String => Boolean = fscSpecific map (_.name) |