Package

caseapp

Permalink

package caseapp

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. caseapp
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. type @@[T, Tag] = AnyRef { type Tag = shapeless.newtype.NewtypeTag[T,Tag] }

    Permalink
  2. trait App extends DefaultArgsApp with DelayedInit

    Permalink

    Have a case class extend this trait for its fields to become command line arguments, and its body the core of your app using these.

    Have a case class extend this trait for its fields to become command line arguments, and its body the core of your app using these.

    Extends DelayedInit, so that the body of the case class gets called later.

    Remaining arguments are accessible via the method remainingArgs.

    Example

    case class Foo(
      i: Int,
      foo: String
    ) extends App {
    
      // core of your app, using the fields above
    
    }
    
    object FooApp extends AppOf[Foo]

    In the example above, FooApp now has a main method, that parses the arguments it is given, and matches these to the fields i (-i 2 gives i the value 2) and foo (--foo ab gives foo the value "ab") of Foo. It also accepts --help / -h / --usage arguments, and prints help or usage messages when these are present.

  3. case class AppName(appName: String) extends Annotation with StaticAnnotation with Product with Serializable

    Permalink

    Name for the annotated case class of arguments E.g.

    Name for the annotated case class of arguments E.g. MyApp

  4. abstract class AppOf[T <: ArgsApp] extends AnyRef

    Permalink

    Have a singleton extends this class to get a class with a main method for the app of T

  5. case class AppVersion(appVersion: String) extends Annotation with StaticAnnotation with Product with Serializable

    Permalink

    App version for the annotated case class of arguments

  6. case class ArgsName(argsName: String) extends Annotation with StaticAnnotation with Product with Serializable

    Permalink

    Name for the extra arguments of the annotated case class of arguments

  7. trait Command extends DefaultCommandArgsApp with DelayedInit

    Permalink

    Have a sealed trait extend this for its case class children to become commands.

    Have a sealed trait extend this for its case class children to become commands.

    Extends DelayedInit like App does.

    Like with App, the remaining arguments are accessible with the method remainingArgs.

    Example

    sealed trait DemoCommand extends Command
    
    case class First(
    ) extends DemoCommand {
    
      // ...
    
    }
    
    case class Second(
    ) extends DemoCommand {
    
      // ...
    
    }
    
    object MyApp extends CommandAppOf[DemoCommand]

    In the example above, MyApp now has a main method, that accepts arguments like first a b or second c d. In the first case, it will create a First, and call its body (whose initialization is delayed thanks to delayed initialization). In the second case, it will create a Second instead, and call its body too.

  8. abstract class CommandAppOf[T <: ArgsApp] extends CommandAppOfWithBase[DefaultBaseCommand, T]

    Permalink
  9. abstract class CommandAppOfWithBase[D <: CommandArgsApp, T <: ArgsApp] extends AnyRef

    Permalink
  10. case class CommandName(commandName: String) extends Annotation with StaticAnnotation with Product with Serializable

    Permalink

    Set the command name of the annotated case class of arguments E.g.

    Set the command name of the annotated case class of arguments E.g. my-app

  11. type CommandParser[T] = caseapp.core.CommandParser[T]

    Permalink
  12. sealed trait Counter extends AnyRef

    Permalink
  13. type ExtraName = Name

    Permalink
  14. case class HelpMessage(message: String) extends Annotation with StaticAnnotation with Product with Serializable

    Permalink

    Help message for the annotated argument

  15. class Hidden extends Annotation with StaticAnnotation

    Permalink

    Do not include this field / argument in the help message

  16. case class Name(name: String) extends Annotation with StaticAnnotation with Product with Serializable

    Permalink

    Extra name for the annotated argument

  17. type Parser[T] = caseapp.core.Parser[T]

    Permalink
  18. case class ProgName(progName: String) extends Annotation with StaticAnnotation with Product with Serializable

    Permalink

    Program name for the annotated case class of arguments E.g.

    Program name for the annotated case class of arguments E.g. my-app

  19. class Recurse extends Annotation with StaticAnnotation

    Permalink
  20. case class ValueDescription(description: String) extends Annotation with StaticAnnotation with Product with Serializable

    Permalink

    Description of the value of the annotated argument

Value Members

  1. object CaseApp

    Permalink
  2. val CommandParser: caseapp.core.CommandParser.type

    Permalink
  3. val Parser: caseapp.core.Parser.type

    Permalink
  4. object Tag

    Permalink
  5. package core

    Permalink
  6. implicit def optionGeneric[T]: Aux[Option[T], :+:[Some[T], :+:[None.type, CNil]]]

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped