CommandLineExt

final class CommandLineExt(command: CommandLine) extends AnyVal

Adds extension methods to org.apache.commons.cli.CommandLine.

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def getArg(index: Int): String

Gets argument at specified index.

Gets argument at specified index.

Value Params
index

argument index

def getArg(index: Int, default: => String): String

Gets argument at specified index or returns default if argument not present.

Gets argument at specified index or returns default if argument not present.

Value Params
default

default value

index

argument index

def getArgCount(): Int

Gets argument count.

Gets argument count.

def hasOptions(opts: Seq[String]): Tuple

Creates sequence corresponding to supplied options indicating whether each option is set or not.

Creates sequence corresponding to supplied options indicating whether each option is set or not.

Value Params
opts

options

def hasOptions(one: String, more: String*): Tuple

Creates sequence corresponding to supplied options indicating whether each option is set or not.

Creates sequence corresponding to supplied options indicating whether each option is set or not.

Value Params
more

additional options

one

option

def mapArg[T](index: Int)(implicit mapper: ValueMapper[T]): T

Maps argument at specified index to type T.

Maps argument at specified index to type T.

Value Params
index

argument index

mapper

value mapper

def mapArg[T](index: Int, default: => T)(implicit mapper: ValueMapper[T]): T

Maps argument at specified index to type T or returns default if argument not present.

Maps argument at specified index to type T or returns default if argument not present.

Value Params
default

default value

index

argument index

mapper

value mapper

def mapArgs[T](implicit mapper: ValueMapper[T]): Seq[T]

Maps arguments to Seq[T].

Maps arguments to Seq[T].

Value Params
mapper

value mapper

def mapOptionValue[T](opt: String)(implicit mapper: ValueMapper[T]): T

Maps option value to type T.

Maps option value to type T.

Value Params
mapper

value mapper

opt

option

Throws
NoSuchElementException

if option value not present

def mapOptionValue[T](opt: String, default: => T)(implicit mapper: ValueMapper[T]): T

Maps option value to type T or returns default if option value not present.

Maps option value to type T or returns default if option value not present.

Value Params
default

default value

mapper

value mapper

opt

option

def mapOptionValues[T](opt: String)(implicit mapper: ValueMapper[T]): Seq[T]

Maps option values to Seq[T].

Maps option values to Seq[T].

Value Params
mapper

value mapper

opt

option