Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package filez
    Definition Classes
    com
  • package scala
    Definition Classes
    filez
  • package getopt

    POSIX getopt(3) command line argument parser with GNU '--' extension.

    POSIX getopt(3) command line argument parser with GNU '--' extension.

    Definition Classes
    scala
    Version

    1.1

  • getopt

class getopt extends AnyRef

POSIX getopt(3) parser with GNU extension '--', but without long options.

Example:
  1. import com.filez.scala.getopt.getopt
    
    object Example extends App {
       protected val g = new getopt(args, "ab:c")
       g.options.get('b').foreach{ arg => println(s"-b arg value is $arg") }
    }
Version

1.1

Since

1.0

Exceptions thrown

java.lang.IllegalArgumentException if input parameters are invalid

java.lang.NoSuchElementException if option is unknown or parameter is missing. Strict mode only.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. getopt
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new getopt(arg: Seq[String], optstring: String, strict: Boolean = false)

    Create immutable getopt instance

    Create immutable getopt instance

    arg

    Sequence of command line arguments. Sequence can be empty but can not contain zero sized strings.

    optstring

    list of legitimate option characters. If character is followed by colon, the option requires argument. Must not be empty.

    strict

    If argument is missing or option is unknown exception is raised.

    Annotations
    @throws("Input parameters are incorrect") @throws("Argument validation failed. Strict mode only")
    Exceptions thrown

    java.lang.IllegalArgumentException if input parameters are invalid

    java.lang.NoSuchElementException if option is unknown or parameter is missing. Strict mode only.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val arguments: Seq[String]

    Command line arguments with options and their arguments removed.

    Command line arguments with options and their arguments removed.

    Since

    1.0

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. val options: Map[Char, String]

    Command line options and their values.

    Command line options and their values. If option does not have argument map contains empty string as value. If command line option was found but not declared in optstring, null is stored.

    Since

    1.0

  16. val options_map: ListMap[Char, Boolean]

    options argument flag map.

    options argument flag map. Value true indicates that option has required argument. This map is created from optstring.

    Since

    1.0

  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. def validate(): Unit

    Validate parsed options.

    Validate parsed options. Throws an Exception if unknown option is encountered or required argument is missing. If getopt is created in strict mode this function is automatically called after options are parsed.

    Annotations
    @throws("If option is unknown or required argument is missing")
    Since

    1.1

    Exceptions thrown

    NoSuchElementException if option is unknown or argument is missing

  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped