CommandPlugin

com.reactific.riddl.commands.CommandPlugin
See theCommandPlugin companion object
abstract class CommandPlugin[OPT <: CommandOptions](val pluginName: String)(implicit evidence$1: ClassTag[OPT]) extends PluginInterface

The service interface for Riddlc command plugins

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Type members

Types

type OptionPlacer[V] = (V, OPT) => OPT

Value members

Abstract methods

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.

Attributes

Returns

A pureconfig.ConfigReader[OPT] that knows how to read OPT

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

Attributes

Returns

A pair: the OParser and the default values for OPT

Concrete methods

def inputFile(f: () => File): OParser[File, OPT]
def loadOptionsFrom(configFile: Path, commonOptions: CommonOptions): Either[Messages, OPT]
def outputDir(f: () => File): OParser[File, OPT]
def parseOptions(args: Array[String]): Option[OPT]
final override def pluginVersion: String

Attributes

Definition Classes
def replaceInputFile(options: OPT, inputFile: Path): OPT
def resolveInputFileToConfigFile(options: OPT, commonOptions: CommonOptions, configFile: Path): OPT
def run(options: OPT, commonOptions: CommonOptions, log: Logger, outputDirOverride: Option[Path]): Either[Messages, PassesResult]

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

Value parameters

commonOptions

The options common to all commands

log

A logger for logging errors, warnings, and info

options

The command specific options

Attributes

Returns

Either a set of Messages on error or a Unit on success

def run(args: Array[String], commonOptions: CommonOptions, log: Logger, outputDirOverride: Option[Path]): Either[Messages, PassesResult]

Inherited methods

Attributes

Inherited from:
PluginInterface

Attributes

Inherited from:
PluginInterface

Concrete fields