abstract class TranslationCommand[OPT <: Options] extends CommandPlugin[OPT]
An abstract base class for translation style commands. That is, they translate an input file into an output directory of files.
- OPT
The option type for the command
- Alphabetic
- By Inheritance
- TranslationCommand
- CommandPlugin
- PluginInterface
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TranslationCommand(name: String)(implicit arg0: ClassTag[OPT])
- name
The name of the command to pass to CommandPlugin
Type Members
- type OptionPlacer[V] = (V, OPT) => OPT
- Definition Classes
- CommandPlugin
Abstract Value Members
- abstract def getConfigReader: ConfigReader[OPT]
Provide a typesafe/Config reader for the commands options.
Provide a typesafe/Config reader for the commands options. This reader should read an object having the same name as the command. The fields of that object must correspond to the fields of the OPT type.
- returns
A pureconfig.ConfigReader[OPT] that knows how to read OPT
- Definition Classes
- CommandPlugin
- abstract def getOptions: (OParser[Unit, OPT], OPT)
Provide an scopt OParser for the commands options type, OPT
Provide an scopt OParser for the commands options type, OPT
- returns
A pair: the OParser and the default values for OPT
- Definition Classes
- CommandPlugin
- abstract def overrideOptions(options: OPT, newOutputDir: Path): OPT
- abstract def translateImpl(validationResult: Result, log: Logger, commonOptions: CommonOptions, options: OPT): Either[Messages, Unit]
Implement this in your subclass to do the translation.
Implement this in your subclass to do the translation. The input will have been parsed and validated already so the job is to translate the root argument into the directory of files.
- log
A Logger to use for messages. Use sparingly, not for errors
- commonOptions
The options common to all commands
- options
The options specific to your subclass implementation
- returns
A Right[Unit] if successful or Left[Messages] if not
- Attributes
- protected
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val builder: OParserBuilder[OPT]
- Attributes
- protected
- Definition Classes
- CommandPlugin
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def inputFile(f: OptionPlacer[File]): OParser[File, OPT]
- Definition Classes
- CommandPlugin
- def interfaceVersion: Int
- Definition Classes
- PluginInterface
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def loadOptionsFrom(configFile: Path, commonOptions: CommonOptions = CommonOptions()): Either[Messages, OPT]
- Definition Classes
- CommandPlugin
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- val optionsClass: Class[_]
- Definition Classes
- CommandPlugin
- def outputDir(f: OptionPlacer[File]): OParser[File, OPT]
- Definition Classes
- CommandPlugin
- def parseOptions(args: Array[String]): Option[OPT]
- Definition Classes
- CommandPlugin
- val pluginName: String
- Definition Classes
- CommandPlugin → PluginInterface
- final def pluginVersion: String
- Definition Classes
- CommandPlugin → PluginInterface
- def replaceInputFile(options: OPT, inputFile: Path): OPT
- Definition Classes
- CommandPlugin
- def resolveInputFileToConfigFile(options: OPT, commonOptions: CommonOptions, configFile: Path): OPT
- Definition Classes
- CommandPlugin
- def riddlVersion: String
- Definition Classes
- PluginInterface
- final def run(originalOptions: OPT, commonOptions: CommonOptions, log: Logger, outputDirOverride: Option[Path]): Either[Messages, Unit]
Execute the command given the options.
Execute the command given the options. Error should be returned as Left(messages) and not directly logged. The log is for verbose or debug output
- commonOptions
The options common to all commands
- log
A logger for logging errors, warnings, and info
- returns
Either a set of Messages on error or a Unit on success
- Definition Classes
- TranslationCommand → CommandPlugin
- def run(args: Array[String], commonOptions: CommonOptions, log: Logger, outputDirOverride: Option[Path] = None): Either[Messages, Unit]
- Definition Classes
- CommandPlugin
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated