Commands
Attributes
- Source
- Commands.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Commands.type
Members list
Value members
Concrete methods
Attributes
- Source
- Commands.scala
Convert a string and some com.ossuminc.riddl.language.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.language.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
- commonOptions
-
The com.ossuminc.riddl.language.CommonOptions to provide to the command.
- name
-
THe name of the command to be converted
Attributes
- Returns
- Source
- Commands.scala
A helper function for reading optional items from a config file.
A helper function for reading optional items from a config file.
Type parameters
- T
-
The Scala type of the config item's value
Value parameters
- default
-
The default value of the config item
- key
-
The name of the optional config item
- mapIt
-
The function to map ConfigCursor to ConfigReader.Result[T]
- objCur
-
The ConfigObjectCursor to start with
Attributes
- Returns
-
The reader for this optional configuration item.
- Source
- Commands.scala
Attributes
- Source
- Commands.scala
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 (runriddlc help
to discover that syntax). Unlikeriddlc
, the first argument must be the name of the command to run. The common options cannot occur ahead of it and are provided by thecommonOptions
argument to this function. - commonOptions
-
The com.ossuminc.riddl.language.CommonOptions that control things like which kinds of messages to put out, whether verbose, debug or quiet mode should be used, whether to show pass and include run times, how to sort the message, whether ANSI color codes should be emitted, etc.
- log
-
An instance of one of the com.ossuminc.riddl.utils.Logger subclasses. This is where all the output from the command will flow, should it succeed. The volume of output can be affected by many of the com.ossuminc.riddl.language.CommonOptions
Attributes
- Returns
-
One of two things:
-
scala.util.Left of com.ossuminc.riddl.language.Messages.Messages if the command fails and the contained com.ossuminc.riddl.language.Messages.Messages, a scala.collection.immutable.List of com.ossuminc.riddl.language.Messages.Message, that explain why it failed
-
scala.util.Right of com.ossuminc.riddl.passes.PassesResult to provide the details of what the com.ossuminc.riddl.passes.Passes that run produced.
-
- Source
- Commands.scala
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.language.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
- commonOptions
-
Overrides the
common-options
section in theconfigFile
. - configFile
-
An optional java.nio.file.Path for the config file. Relative or full paths are fine.
- log
-
Where to send the commands output. See com.ossuminc.riddl.utils.Logger and its subclasses for options.
- 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:
-
scala.util.Left of com.ossuminc.riddl.language.Messages.Messages, which is a list of com.ossuminc.riddl.language.Messages.Message, that explain why it failed.
-
scala.util.Right of com.ossuminc.riddl.passes.PassesResult to provide the details of what the com.ossuminc.riddl.passes.Passes that run produced.
-
- Source
- Commands.scala
Attributes
- Source
- Commands.scala