diff options
| author | Schuyler Eldridge | 2018-11-15 21:50:29 -0500 |
|---|---|---|
| committer | Schuyler Eldridge | 2018-11-21 23:22:11 -0500 |
| commit | 696bc256a90cc80bcb094aaeada8eea51a643ae0 (patch) | |
| tree | 8435ab570e88b60ca6af127e607794c64565bb9c /src/main/scala/firrtl/options/Shell.scala | |
| parent | 4a2211c1602b37a65b4e44c3b7ebe82e8bfeedc0 (diff) | |
Change firrtl.options API, add Phase
This breaks firrtl.options.Stage into a small type hierarchy:
* Phase: something that transforms an AnnotationSeq
* Stage extends Phase: a Phase with a Command Line Interface
Some of the old "common options" (input annotation file and target
directory) are moved into firrtl.options and provided as part of the Stage
class. Stage will automatically preprocess an input annotation sequence to
resolve all input annotation files and add a default target directory.
Minor changes:
* Adds ViewException
* Stops mixing in the DoNotTerminateOnExit trait into the default Shell
parser
* Add StageOptionsView
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'src/main/scala/firrtl/options/Shell.scala')
| -rw-r--r-- | src/main/scala/firrtl/options/Shell.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/scala/firrtl/options/Shell.scala b/src/main/scala/firrtl/options/Shell.scala index b9278f30..4fb89450 100644 --- a/src/main/scala/firrtl/options/Shell.scala +++ b/src/main/scala/firrtl/options/Shell.scala @@ -19,7 +19,7 @@ case class OptionsException(msg: String, cause: Throwable = null) extends Except class Shell(val applicationName: String) { /** Command line argument parser (OptionParser) with modifications */ - final val parser = new OptionParser[AnnotationSeq](applicationName) with DoNotTerminateOnExit with DuplicateHandling + final val parser = new OptionParser[AnnotationSeq](applicationName) with DuplicateHandling /** Contains all discovered [[RegisteredLibrary]] */ lazy val registeredLibraries: Seq[RegisteredLibrary] = { @@ -60,4 +60,8 @@ class Shell(val applicationName: String) { .getOrElse(throw new OptionsException("Failed to parse command line options", new IllegalArgumentException)) } + parser.note("Shell Options") + Seq( InputAnnotationFileAnnotation(), + TargetDirAnnotation() ) + .map(_.addOptions(parser)) } |
