kadai.cmdopts

CmdOpts

abstract class CmdOpts[T] extends AnyRef

This class implements a simple but type-safe command-line option parser.

You will generally use this by declaring an object that extends CmdOpts and passing in args (the array of cmd-line String arguments).

You then ask for the specific options by calling 'opt' with the String for the option name, and a function that takes the next n Strings and returns a thing of the type you want. If the arguments are found they are passed to the function and the result is returned inside a Some, if they cannot be found or an exception is thrown from the function, a None is returned.

Validation error messages can be specified by implementing the validate method.

Usage and Version messages can be specified by implementing the usage and version methods respectively.

See also

Example.scala

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

Instance Constructors

  1. new CmdOpts(rawdata: Seq[T])

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. final def ==(arg0: AnyRef): Boolean

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

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def check[R](xopt: Option[R], err: String): ValidationNel[String, R]

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  13. def handleErrors(xs: NonEmptyList[String]): Unit

    Attributes
    protected
  14. def handleInfo(): Unit

    Attributes
    protected
  15. def hashCode(): Int

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

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

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

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

    Definition Classes
    AnyRef
  20. def opt[H <: HList, N <: Nat, F, R](t: T, f: F)(implicit hlister: shapeless.ops.function.FnToProduct.Aux[F, (H) ⇒ R], length: Aux[H, N], toHList: FromTraversable[H], size: ToInt[N]): Option[R]

    Find the supplied command-line option, if given.

    Find the supplied command-line option, if given.

    Note: will require import kadai.cmdopts.nat._ to get the Nat instances it requires.

  21. val startup: Option[Unit]

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

    Definition Classes
    AnyRef
  23. def toString(): String

    Definition Classes
    AnyRef → Any
  24. def usage: Option[String]

    Attributes
    protected
  25. def validate: ValidationNel[String, _]

    Attributes
    protected
  26. def version: Option[String]

    Attributes
    protected
  27. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped