aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-02-26 22:48:13 +0800
committerChristopher Vogt <oss.nsp@cvogt.org>2017-02-27 18:44:53 +0800
commitf9ba2e5798fac11acc2991a69b0c7d579ea631d6 (patch)
tree7b2b7d26854fd38ff2e6028d5ce584d3ea76bb2f
parentcbe11911183ccf077975d7f3851c664d38ecdd94 (diff)
downloadcbt-f9ba2e5798fac11acc2991a69b0c7d579ea631d6.tar.gz
cbt-f9ba2e5798fac11acc2991a69b0c7d579ea631d6.tar.bz2
cbt-f9ba2e5798fac11acc2991a69b0c7d579ea631d6.zip
use .apply feature instead of special coding for tools usage string
-rw-r--r--stage2/Lib.scala1
-rw-r--r--stage2/ToolsTasks.scala2
2 files changed, 2 insertions, 1 deletions
diff --git a/stage2/Lib.scala b/stage2/Lib.scala
index d72c82f..cc48e60 100644
--- a/stage2/Lib.scala
+++ b/stage2/Lib.scala
@@ -177,7 +177,6 @@ final class Lib(val logger: Logger) extends Stage1Lib(logger){
case None => ""
case d: Dependency => lib.usage(d.getClass, d.show())
case c: ClassPath => c.string
- case t:ToolsStage2.type => "Available methods: " ++ lib.taskNames(t.getClass).mkString(" ")
case ExitCode(int) => System.err.println(int); System.exit(int); ???
case _ => obj.toString
}
diff --git a/stage2/ToolsTasks.scala b/stage2/ToolsTasks.scala
index 0cfd501..b5e94d4 100644
--- a/stage2/ToolsTasks.scala
+++ b/stage2/ToolsTasks.scala
@@ -10,6 +10,8 @@ class ToolsTasks(
cbtHome: File,
cbtLastModified: Long
)(implicit classLoaderCache: ClassLoaderCache){
+ def apply: String = "Available methods: " ++ lib.taskNames(getClass).mkString(" ")
+
private val paths = CbtPaths(cbtHome, cache)
import paths._
implicit val logger: Logger = lib.logger