This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/master by this push:
new 4d3e0c3 Update NCStart.scala
4d3e0c3 is described below
commit 4d3e0c3c5358ced702e60e8c6b15cba15e6df61f
Author: Aaron Radzinski <[email protected]>
AuthorDate: Mon Oct 4 21:26:28 2021 -0700
Update NCStart.scala
---
.../main/scala/org/apache/nlpcraft/NCStart.scala | 67 +---------------------
1 file changed, 2 insertions(+), 65 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCStart.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCStart.scala
index 9a62c4a..7fb367c 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCStart.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCStart.scala
@@ -17,70 +17,7 @@
package org.apache.nlpcraft
-import com.typesafe.scalalogging.LazyLogging
-import org.apache.nlpcraft.common.version.NCVersion
-import org.apache.nlpcraft.probe.NCProbe
-import org.apache.nlpcraft.server.NCServer
-import org.apache.nlpcraft.common._
-import org.apache.nlpcraft.common.ansi.NCAnsi._
-import org.apache.nlpcraft.model.tools.cmdline.NCCli
-
/**
- * Server or probe command line starter.
+ *
*/
-object NCStart extends App with LazyLogging {
- /**
- *
- */
- private def execute(): Unit = {
- val seq = args.toSeq
-
- val isSrv = seq.indexWhere(_ == "-server") >= 0
- val isPrb = seq.indexWhere(_ == "-probe") >= 0
- val isCli = seq.indexWhere(_ == "-cli") >= 0
-
- /**
- *
- * @param p
- * @return
- */
- def removeParam(p: String): Array[String] = seq.filter(_ != p).toArray
-
- /**
- *
- * @param msgs
- */
- def error(msgs: String*): Unit = {
- val ver = NCVersion.getCurrent
-
- logger.info(
- U.NL +
- U.asciiLogo8Bit() +
- s"${U.NL}" +
- s"Version: ${ansiBold(ver.version)}${U.NL}" +
- s"${NCVersion.copyright}${U.NL}"
- )
-
- for (msg <- msgs)
- logger.error(msg)
-
- logger.info(g("Usage:"))
- logger.info(" Use '-server' argument to start server.")
- logger.info(" Use '-probe' argument to start probe.")
- logger.info(" Use '-cli' argument to start CLI.")
-
- System.exit(1)
- }
-
- if (!isSrv && !isPrb && !isCli)
- error("Either '-server', '-probe' or '-cli' argument must be
provided.")
- else if (isPrb)
- NCProbe.main(removeParam("-probe"))
- else if (isSrv)
- NCServer.main(removeParam("-server"))
- else if (isCli)
- NCCli.main(removeParam("-cli"))
- }
-
- execute()
-}
+object NCStart extends App