p

caseapp

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] }
  2. abstract class CaseApp [T] extends AnyRef
  3. abstract class CommandApp [T] extends CommandAppWithPreCommand[DefaultBaseCommand, T]
  4. abstract class CommandAppWithPreCommand [D, T] extends AnyRef
  5. type CommandParser[T] = caseapp.core.CommandParser[T]
  6. sealed trait Counter extends AnyRef
  7. type ExtraName = Name
  8. type Parser[T] = caseapp.core.Parser[T]
  9. final case class RemainingArgs (remainingArgs: Seq[String], unparsedArgs: Seq[String]) extends Product with Serializable
  10. trait App extends DefaultArgsApp with DelayedInit

    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

    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

    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]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0-M2) Use CommandApp instead

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

    (Since version 1.2.0-M2) Use CommandAppWithPreCommand instead

Value Members

  1. val CommandParser: caseapp.core.CommandParser.type
  2. val Parser: caseapp.core.Parser.type
  3. implicit def optionGeneric[T]: Aux[Option[T], :+:[Some[T], :+:[None.type, CNil]]]
  4. object CaseApp
  5. object Tag

Inherited from AnyRef

Inherited from Any

Ungrouped