diff options
author | Paul Phillips <paulp@improving.org> | 2010-04-21 17:06:38 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-04-21 17:06:38 +0000 |
commit | a17a4dc15730ce004ca8c9495c850dfca1062c24 (patch) | |
tree | 5dbd27fc4476a3bd3f16d1fbbee4647b633f242b /src/compiler/scala/tools/cmd/Meta.scala | |
parent | cf26f620707be4bd9f8bc30a733eb4a987894421 (diff) | |
download | scala-a17a4dc15730ce004ca8c9495c850dfca1062c24.tar.gz scala-a17a4dc15730ce004ca8c9495c850dfca1062c24.tar.bz2 scala-a17a4dc15730ce004ca8c9495c850dfca1062c24.zip |
Since pickled data moved into annotations ShowP...
Since pickled data moved into annotations ShowPickled has been
confusedly scratching its head. Made tools/showPickled work again. In
the process created a simple interface for creating command line tools
for the (majority of) commands which would just like to specify a
handful of options. No review.
Diffstat (limited to 'src/compiler/scala/tools/cmd/Meta.scala')
-rw-r--r-- | src/compiler/scala/tools/cmd/Meta.scala | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/cmd/Meta.scala b/src/compiler/scala/tools/cmd/Meta.scala index 5a09766b13..8609db3d50 100644 --- a/src/compiler/scala/tools/cmd/Meta.scala +++ b/src/compiler/scala/tools/cmd/Meta.scala @@ -22,11 +22,11 @@ object Meta { trait StdOpts { self: Spec with Interpolation => - Bash.name --> runAndExit(Bash.action()) - val runnerFileName = Runner.name --| ; + Bash.name --> runAndExit(Bash.action()) + val selfUpdateName = SelfUpdate.name --| ; - if (runnerFileName.isDefined) - runAndExit(Runner.action()) + if (selfUpdateName.isDefined) + runAndExit(SelfUpdate.action()) /** I think we're as close as we can get to bundling completion with * the program given the constraints imposed by bash. This outputs @@ -47,12 +47,17 @@ object Meta { } } - /** A very basic runner script. + /** Generates a very basic runner script. It's called SelfUpdate + * because once it exists you can do something like + * + * tools/scmp --self-update tools/scmp + * + * and it will overwrite itself with the current version. */ - object Runner extends Opt { - val name = "generate-runner" + object SelfUpdate extends Opt { + val name = "self-update" val action = () => { - val file = File(runnerFileName.get) + val file = File(selfUpdateName.get) file writeAll interpolate(runnerTemplate) file setExecutable true () |