more standard: let OS pick random port by default;
authorFabian Huch <huch@in.tum.de>
Sat, 01 Feb 2025 18:29:07 +0100
changeset 82031 9bf58aff60d0
parent 82030 bae948b1132b
child 82032 9bc4f982aef4
more standard: let OS pick random port by default;
NEWS
src/Tools/Find_Facts/src/find_facts.scala
--- a/NEWS	Sat Feb 01 15:00:39 2025 +0100
+++ b/NEWS	Sat Feb 01 18:29:07 2025 +0100
@@ -388,7 +388,7 @@
 Apache Solr (see also https://solr.apache.org). Minimal example:
 
     isabelle find_facts_index HOL
-    isabelle find_facts_server
+    isabelle find_facts_server -p 8080
     open http://localhost:8080/find_facts#search?q=Hilbert
 
 Persistent data is stored in $ISABELLE_HOME_USER/find_facts/.
--- a/src/Tools/Find_Facts/src/find_facts.scala	Sat Feb 01 15:00:39 2025 +0100
+++ b/src/Tools/Find_Facts/src/find_facts.scala	Sat Feb 01 18:29:07 2025 +0100
@@ -888,11 +888,9 @@
   val web_sources: Path = Path.explode("$FIND_FACTS_HOME/web")
   val web_dir: Path = Path.explode("$FIND_FACTS_HOME_USER/web")
 
-  val default_port = 8080
-
   def find_facts_server(
     options: Options,
-    port: Int = default_port,
+    port: Int = 0,
     devel: Boolean = false,
     progress: Progress = new Progress
   ): Unit = {
@@ -977,7 +975,7 @@
     Command_Line.tool {
       var devel = false
       var options = Options.init()
-      var port = default_port
+      var port = 0
       var verbose = false
 
       val getopts = Getopts("""
@@ -986,7 +984,7 @@
   Options are:
     -d           devel mode
     -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)
-    -p PORT      explicit web server port (default: """ + default_port + """)
+    -p PORT      explicit server port
     -v           verbose server
 
   Run server for Find_Facts.