Package

wvlet.airframe

opts

Permalink

package opts

Visibility
  1. Public
  2. All

Type Members

  1. trait CLArgItem extends CLOptionItem

    Permalink
  2. case class CLArgument(path: Path, arg: argument, argIndex: Int, param: Parameter) extends CLOptionItemBase with CLArgItem with Product with Serializable

    Permalink

    CommandTrait line argument type and the associated class parameter

  3. case class CLOption(path: Path, annot: option, param: Parameter) extends CLOptionItemBase with Product with Serializable

    Permalink

    CommandTrait line option and the associated class parameter

  4. sealed trait CLOptionItem extends AnyRef

    Permalink

    command-line option

  5. abstract class CLOptionItemBase extends CLOptionItem

    Permalink
  6. class ClassOptionSchema extends OptionSchema

    Permalink

    OptionSchema created from a class definition

  7. trait CommandModule extends AnyRef

    Permalink

    // Define your command set
    class MyCommandSet {
       \@command
       def hello = println("hello")
    
       \@command
       def world = println("world")
    }
    
    // Integrate the above command set as a module with a given name.
    // Command can be invoked as "sample hello" and "sample world".
    class MyModule extends CommandModule {
      def modules = Seq(ModuleDef[MyCommandSet]("sample", description="my command set"))
    }
    
    Launcher[MyModule].execute("sample hello") // prints hello
  8. case class CommandNameArgument(path: Path) extends CLArgItem with Product with Serializable

    Permalink
  9. trait DefaultCommand extends AnyRef

    Permalink

    Implement this trait to supply a default command invoked when no command name is specified.

  10. class Launcher extends LogSupport

    Permalink

    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
  11. class MethodOptionSchema extends OptionSchema

    Permalink

    OptionSchema created from a method definition

  12. case class ModuleDef[A](name: String, description: String = "")(implicit evidence$1: scala.reflect.api.JavaUniverse.TypeTag[A]) extends Product with Serializable

    Permalink
  13. class OptionParser extends LogSupport

    Permalink

    CommandTrait-line argument parser

  14. case class OptionParserResult(parseTree: ValueHolder[String], unusedArgument: Array[String], showHelp: Boolean) extends LogSupport with Product with Serializable

    Permalink
  15. trait OptionSchema extends LogSupport

    Permalink

    Schema of the command line options

  16. class StringTemplate extends AnyRef

    Permalink

  17. trait ValueHolder[+A] extends AnyRef

    Permalink

    Holder of structured data consisting of named values.

    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 = Empty.set("a", apple)  =>  Node(a -> Leaf(apple))
    val n2 = n1.set("B.b", "book")
    => Node(a -> Leaf(apple), B -> Empty.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)))
    
    

  18. class argument extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  19. class command extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  20. class option extends Annotation with Annotation with ClassfileAnnotation

    Permalink

Value Members

  1. object ClassOptionSchema extends LogSupport

    Permalink
  2. object CommandLineTokenizer extends RegexParsers with LogSupport

    Permalink

    Tokenize single string representations of command line arguments into Array[String]

  3. object CommandModule

    Permalink
  4. object Launcher extends LogSupport

    Permalink

    Command launcher

  5. object OptionParser extends LogSupport

    Permalink

    Creates option parsers

  6. object StringTemplate

    Permalink
  7. object ValueHolder extends LogSupport

    Permalink

Ungrouped