Class/Object

kadai.cmdopts

CmdOpts

Related Docs: object CmdOpts | package cmdopts

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

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

    Permalink
  6. def clone(): AnyRef

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

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

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

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

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

    Permalink
    Attributes
    protected
  12. def handleInfo(): Unit

    Permalink
    Attributes
    protected
  13. def hashCode(): Int

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

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

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. 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]

    Permalink

    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.

  19. val startup: Option[Unit]

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

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

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

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

    Permalink
    Attributes
    protected
  24. def version: Option[String]

    Permalink
    Attributes
    protected
  25. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped