aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/options/Registration.scala
diff options
context:
space:
mode:
authorSchuyler Eldridge2018-11-07 13:48:06 -0500
committerGitHub2018-11-07 13:48:06 -0500
commit17b4e9835bd95dcf91c5ea5a4d7c52280031ea93 (patch)
treee54301b8019d17cce4448ce9d09589815a7315d5 /src/main/scala/firrtl/options/Registration.scala
parentd04af59c233cec994087df3d0d3fff14e20ac04c (diff)
parent27c1b366ce58e93434e77e964365474f5e7aa8d7 (diff)
Merge pull request #879 from seldridge/issue-764-refactor-pr-pointer-optionsPackage
- Adds firrtl.options package and tests - Does not use firrtl.options in any way
Diffstat (limited to 'src/main/scala/firrtl/options/Registration.scala')
-rw-r--r--src/main/scala/firrtl/options/Registration.scala36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/scala/firrtl/options/Registration.scala b/src/main/scala/firrtl/options/Registration.scala
new file mode 100644
index 00000000..481c095b
--- /dev/null
+++ b/src/main/scala/firrtl/options/Registration.scala
@@ -0,0 +1,36 @@
+// See LICENSE for license details.
+
+package firrtl.options
+
+import firrtl.{AnnotationSeq, Transform}
+
+import scopt.OptionParser
+
+/** Indicates that this class/object includes options (but does not add these as a registered class)
+ */
+trait HasScoptOptions {
+
+ /** This method will be called to add options to an OptionParser
+ * @param p an option parser
+ */
+ def addOptions(p: OptionParser[AnnotationSeq]): Unit
+}
+
+/** A [[Transform]] that includes options that should be exposed at the top level.
+ *
+ * @note To complete registration, include an entry in
+ * src/main/resources/META-INF/services/firrtl.options.RegisteredTransform */
+trait RegisteredTransform extends HasScoptOptions { this: Transform => }
+
+/** A class that includes options that should be exposed as a group at the top level.
+ *
+ * @note To complete registration, include an entry in
+ * src/main/resources/META-INF/services/firrtl.options.RegisteredLibrary */
+trait RegisteredLibrary extends HasScoptOptions {
+
+ /** The name of this library.
+ *
+ * This will be used when generating help text.
+ */
+ def name: String
+}