aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/options/Registration.scala
diff options
context:
space:
mode:
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
+}