com.filez.scala.getopt

getopt

class getopt extends AnyRef

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

Annotations
@throws( "Input parameters are incorrect" ) @throws( ... )
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
Learn more about member selection
Visibility
  1. Public
  2. All

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.

    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: 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. 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

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  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 hashCode(): Int

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

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

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

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

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

  19. 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

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

    Definition Classes
    AnyRef
  21. def toString(): String

    Definition Classes
    AnyRef → Any
  22. 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( ... )
    Since

    1.1

    Exceptions thrown
    NoSuchElementException

    if option is unknown or argument is missing

  23. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped