wvlet.airframe.launcher

Type members

Classlikes

object ClassOptionSchema extends LogSupport
Companion:
class
class ClassOptionSchema(val surface: Surface, val options: Seq[CLOption], val args: Seq[CLArgItem]) extends OptionSchema

OptionSchema created from a class definition

OptionSchema created from a class definition

Companion:
object
class CommandLauncher(val launcherInfo: LauncherInfo, val optionParser: OptionParser, val subCommands: Seq[CommandLauncher], defaultCommand: Option[LauncherInstance => Any]) extends CommandLauncherBaseCompat with LogSupport

Command launcher.

Command launcher.

class MyCommand(@option(prefix="-h,--help", description="display help", isHelp=true) help:Boolean) {
 @command(description="Say hello")
 def hello(@option(prefix="-r", description="repeat times")
           repeat:Int=1,
           @argument
           message:String = "hello") {
     for(i <- 0 until repeat) println(message)
 }
}

Launcher.execute[MyCommand]("hello -r 3")  // hello x 3

Interface for printing help messages

Interface for printing help messages

Companion:
object
object HelpMessagePrinter extends LogSupport with AnsiColorPalette
Companion:
class
object Launcher extends LauncherCompat with LogSupport

Command launcher

Command launcher

Companion:
class
case class Launcher extends LauncherBaseCompat
Companion:
object
case class LauncherInfo(name: String, description: String, usage: String, isDefault: Boolean)
case class LauncherInstance(launcher: CommandLauncher, instance: Any)
case class LauncherResult(launcherStack: List[LauncherInstance], result: Option[Any])

Command execution results

Command execution results

class MethodOptionSchema(val method: MethodSurface) extends OptionSchema

OptionSchema created from a method definition

OptionSchema created from a method definition

object OptionParser extends LogSupport

Creates option parsers

Creates option parsers

Companion:
class
class OptionParser(val schema: OptionSchema) extends LogSupport

CommandTrait-line argument parser

CommandTrait-line argument parser

Companion:
object
sealed trait OptionSchema extends LogSupport

Schema of the command line options

Schema of the command line options

sealed trait StringTree

Holder of structured data consisting of named values. ValueHolder is immutable, so the set operations in this class return another ValueHolder and never modify the original ValueHolder.

Holder of structured data consisting of named values. ValueHolder is immutable, so the set operations in this class return another ValueHolder and never modify the original ValueHolder.

A(a, B(b, c))

{ a: apple, B:{b:book, c:car} }

val n1 = EmptyNode.set("a", apple) => Node(a -> Leaf(apple))
val n2 = n1.set("B.b", "book") => Node(a -> Leaf(apple), B -> EmptyNode.set("b", "book")) => Node(a -> apple, B -> Node(b -> Leaf(book)))
val n3 = n2.set("B.c", "car") => Node(a -> apple, B -> Node(b -> Leaf(book), c -> Leaf(car)))

Companion:
object
object StringTree extends LogSupport
Companion:
class
object StringTreeCodec extends MessageCodec[StringTree]