package textapp

object TextAppMain {
  def main(args: Array[String]) {
    if (args.contains("--server") || args.contains("-s")) { 
      new ServerApp
      println("Server application started")
    } else {
      val clientApp = new ClientApp
      println("Client application started")
    }
  }
}


package textapp

object TextAppMain {
  def main(args: Array[String]) {
    val serverApp = new ServerApp
    val clientApp = new ClientApp
    println("Text Application started")
  }
}


--- 
+++ 
@@ -2,9 +2,13 @@
 
 object TextAppMain {
   def main(args: Array[String]) {
-    val serverApp = new ServerApp
-    val clientApp = new ClientApp
-    println("Text Application started")
+    if (args.contains("--server") || args.contains("-s")) { 
+      new ServerApp
+      println("Server application started")
+    } else {
+      val clientApp = new ClientApp
+      println("Client application started")
+    }
   }
 }
 
app: Use -s (--server) commandline arg to start server

Instead of always starting the server, control the startup with a
command-line argument.

Signed-off-by: Aki Saarinen <2c8035bb80cf98a391872dcbe797b269d759f6d9@reaktor.fi>
