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. abstract class CaseApp[T] extends AnyRef

    Permalink
  3. abstract class CommandApp[T] extends CommandAppWithPreCommand[DefaultBaseCommand, T]

    Permalink
  4. abstract class CommandAppWithPreCommand[D, T] extends AnyRef

    Permalink
  5. type CommandParser[T] = caseapp.core.CommandParser[T]

    Permalink
  6. sealed trait Counter extends AnyRef

    Permalink
  7. type ExtraName = Name

    Permalink
  8. type Parser[T] = caseapp.core.Parser[T]

    Permalink
  9. final case class RemainingArgs(remainingArgs: Seq[String], unparsedArgs: Seq[String]) extends Product with Serializable

    Permalink
  10. 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.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0-M2) See CaseApp instead

  11. 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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0-M2) Use CaseApp instead

  12. 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.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0-M2) See CommandApp instead

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

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0-M2) Use CommandApp instead

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

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0-M2) Use CommandAppWithPreCommand instead

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