io.mth.pirate

Command

sealed trait Command[A] extends AnyRef

Command data type. Represents a command name; a possible description; a set of flags; and positional parameters.

The data type includes combinators for building up more complex commands from a simple command name.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Command
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def fold[X](x: (String, Option[String], Flags[A], Positionals[A]) ⇒ X): X

    Catamorphism for Command data type.

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def <<|>>(flag: Flags[A]): Command[A]

    Combine this command with a new set of flags, and return the the new command.

    Combine this command with a new set of flags, and return the the new command. The operation to combine flags is associative.

  5. def <|>(flag: Flag[A]): Command[A]

    Combine this command with a new flag, and return the the new command.

    Combine this command with a new flag, and return the the new command. The operation to combine flags is associative.

  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. def >|(positionals: Positionals[A]): Command[A]

    Combine this command with a set of positional parameters, and return the new command.

    Combine this command with a set of positional parameters, and return the new command. The operation to combine positional parameters is NOT associative. Parsing and generating a usage string is heavily dependent on the order in which positional parameters added to the command.

  9. def >|(positional: Positional[A]): Command[A]

    Combine this command with a new positional parameters, and return the new command.

    Combine this command with a new positional parameters, and return the new command. The operation to combine positional parameters is NOT associative. Parsing and generating a usage string is heavily dependent on the order in which positional parameters added to the command.

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def description: Option[String]

    The description of this command.

  13. def dispatch(args: List[String], default: A)(success: (A) ⇒ Unit)(error: (String) ⇒ Unit): Int

    Higher order function to handle parse and dispatch.

    Higher order function to handle parse and dispatch. This is a convenience only.

  14. def dispatchOrDie(args: List[String], default: A, err: PrintStream = System.err)(f: (A) ⇒ Unit): Unit

    Higher order function to handle parse and dispatch.

    Higher order function to handle parse and dispatch. This is a convenience only.

  15. def dispatchOrUsage(args: List[String], default: A, err: PrintStream = System.err)(f: (A) ⇒ Unit): Int

    Higher order function to handle parse and dispatch.

    Higher order function to handle parse and dispatch. This is a convenience only.

  16. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. def name: String

    The name of this command.

  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  26. def parse(args: List[String], default: A): Validation[String, A]

    Parse a list of arguments based on this command and apply the resultant function to the data object.

  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  28. def toParser: Parser[(A) ⇒ A]

    Create an argument parser for this command.

    Create an argument parser for this command. This is for advanced usage only. It is expected that the parse method is sufficient for most cases.

  29. def toString(): String

    Definition Classes
    AnyRef → Any
  30. def usage: String

    The usage string for this command using the default usage mode.

    The usage string for this command using the default usage mode. Equivalent to usageForMode(DefaultUsageMode).

  31. def usageForMode(mode: UsageMode): String

    The usage string for this command using the specified usage mode.

  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def ~(description: String): Command[A]

    Combine this command with the specified description and return the new description.

    Combine this command with the specified description and return the new description. If a description is already set it shall be replaced.

Inherited from AnyRef

Inherited from Any

Ungrouped