Commands

com.ossuminc.riddl.commands.Commands
object Commands

Attributes

Source
Commands.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Commands.type

Members list

Value members

Concrete methods

def loadCandidateCommands(configFile: Path)(using io: PlatformContext): Either[Messages, Seq[String]]

Attributes

Source
Commands.scala

Convert a string and some com.ossuminc.riddl.utils.CommonOptions into either a com.ossuminc.riddl.command.Command or some com.ossuminc.riddl.language.Messages.Messages Note that the com.ossuminc.riddl.command.CommandOptions will be passed to the command when you run it.

Convert a string and some com.ossuminc.riddl.utils.CommonOptions into either a com.ossuminc.riddl.command.Command or some com.ossuminc.riddl.language.Messages.Messages Note that the com.ossuminc.riddl.command.CommandOptions will be passed to the command when you run it.

Value parameters

name

The name of the command to be converted

Attributes

Returns
Source
Commands.scala
def runCommandNamed(name: String, optionsPath: Path, outputDirOverride: Option[Path])(using io: PlatformContext): Either[Messages, PassesResult]

Attributes

Source
Commands.scala

Probably the easiest way to run a command if you're familiar with the command line options and still get the com.ossuminc.riddl.language.Messages.Messages or com.ossuminc.riddl.passes.PassesResult objects out of it.

Probably the easiest way to run a command if you're familiar with the command line options and still get the com.ossuminc.riddl.language.Messages.Messages or com.ossuminc.riddl.passes.PassesResult objects out of it.

Value parameters

args

An Array of arguments, one argument per array element. This should follow the same pattern as by the riddlc command line options (run riddlc help to discover that syntax). Unlike riddlc, the first argument must be the name of the command to run. The common options cannot occur ahead of it and are provided by the commonOptions argument to this function.

Attributes

Returns

One of two things:

Source
Commands.scala
def runFromConfig(configFile: Option[Path], targetCommand: String, commandName: String)(using io: PlatformContext): Either[Messages, PassesResult]

An easy way to run the from command which loads commands and their options from a .config file and uses them as defaults.

An easy way to run the from command which loads commands and their options from a .config file and uses them as defaults. The com.ossuminc.riddl.utils.CommonOptions specification in the .config file can be overridden with the commonOptions argument.

Value parameters

commandName

The name of the command that is invoking this method, if it matters

configFile

An optional java.nio.file.Path for the config file. Relative or full paths are fine.

targetCommand

The command to run. This must match a config setting in the configFile that provides the arguments for that command.

Attributes

Returns

One of two things:

Source
Commands.scala
def runMain(args: Array[String])(using pc: PlatformContext): Int

Attributes

Source
Commands.scala