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
commit c25ab35e6518317686b0d181e53b27952d23a27e Author: Aaron Radzinski <[email protected]> AuthorDate: Tue Oct 13 02:20:56 2020 -0700 WIP. --- .../examples/lightswitch/LightSwitchModel.scala | 2 +- .../nlpcraft/model/tools/cmdline/NCCli.scala | 69 +++++++++------------- 2 files changed, 28 insertions(+), 43 deletions(-) diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModel.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModel.scala index c9c0479..261b239 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModel.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/lightswitch/LightSwitchModel.scala @@ -67,6 +67,6 @@ class LightSwitchModel extends NCModelFileAdapter("org/apache/nlpcraft/examples/ // Add HomeKit, Arduino or other integration here. // By default - just return a descriptive action string. - NCResult.text(s"Lights '$status' in '${locations.toLowerCase}'.") + NCResult.text(s"Lights are [$status] in [${locations.toLowerCase}].") } } diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala index f147382..ce1f318 100644 --- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala +++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala @@ -1043,19 +1043,6 @@ object NCCli extends App { } /** - * - * @param pathOpt - */ - private def checkDirPath(pathOpt: Option[Argument]): Unit = { - if (pathOpt.isDefined) { - val file = new File(stripQuotes(pathOpt.get.value.get)) - - if (!file.exists() || !file.isDirectory) - throw new IllegalArgumentException(s"Directory not found: ${c(file.getAbsolutePath)}") - } - } - - /** * @param cmd Command descriptor. * @param args Arguments, if any, for this command. * @param repl Whether or not running from REPL. @@ -1224,10 +1211,10 @@ object NCCli extends App { logln(g(" [OK]")) logServerInfo(beacon) + showTip() + if (state.accessToken.isDefined) logln(s"Signed in with default '${c("[email protected]")}' user.") - - showTip() } } } @@ -1695,38 +1682,36 @@ object NCCli extends App { logln(s"Local REST server:\n${tbl.toString}") - if (state.probes.nonEmpty) { - tbl = new NCAsciiTable + tbl = new NCAsciiTable - def addProbeToTable(tbl: NCAsciiTable, probe: Probe): NCAsciiTable = { - tbl += ( - Seq( - probe.probeId, - s" ${c("guid")}: ${probe.probeGuid}", - s" ${c("tok")}: ${probe.probeToken}" - ), - DurationFormatUtils.formatDurationHMS(currentTime - probe.startTstamp), - Seq( - s"${probe.hostName} (${probe.hostAddr})", - s"${probe.osName} ver. ${probe.osVersion}" - ), - probe.models.toList.map(m ⇒ s"${b(m.id)}, v${m.version}") - ) + def addProbeToTable(tbl: NCAsciiTable, probe: Probe): NCAsciiTable = { + tbl += ( + Seq( + probe.probeId, + s" ${c("guid")}: ${probe.probeGuid}", + s" ${c("tok")}: ${probe.probeToken}" + ), + DurationFormatUtils.formatDurationHMS(currentTime - probe.startTstamp), + Seq( + s"${probe.hostName} (${probe.hostAddr})", + s"${probe.osName} ver. ${probe.osVersion}" + ), + probe.models.toList.map(m ⇒ s"${b(m.id)}, v${m.version}") + ) - tbl - } + tbl + } - tbl #= ( - "Probe ID", - "Uptime", - "Host / OS", - "Models Deployed" - ) + tbl #= ( + "Probe ID", + "Uptime", + "Host / OS", + "Models Deployed" + ) - state.probes.foreach(addProbeToTable(tbl, _)) + state.probes.foreach(addProbeToTable(tbl, _)) - logln(s"Connected probes:\n${tbl.toString}") - } + logln(s"Connected probes:\n${tbl.toString}") } /**
