Args

com.phasmidsoftware.args.Args
See theArgs companion object
case class Args[X](xas: Seq[Arg[X]]) extends Iterable[Arg[X]]

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Iterable[Arg[X]]
trait IterableFactoryDefaults[Arg[X], Iterable]
trait IterableOps[Arg[X], Iterable, Iterable[Arg[X]]]
trait IterableOnceOps[Arg[X], Iterable, Iterable[Arg[X]]]
trait IterableOnce[Arg[X]]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def ++(xq: Args[X]): Args[X]

Method to concatenate this Args[X] with xq.

Method to concatenate this Args[X] with xq.

Value parameters

xq

an Args[X].

Attributes

Returns

a new Args[X].

def +:(xa: Arg[X]): Args[X]

Method to prepend an Arg[X] to this Args[X].

Method to prepend an Arg[X] to this Args[X].

Value parameters

xa

the Arg[X] to be prepended.

Attributes

Returns

a new Args[X].

def :+(xa: Arg[X]): Args[X]

Method to append an Arg[X] to this Args[X].

Method to append an Arg[X] to this Args[X].

Value parameters

xa

the Arg[X] to be appended.

Attributes

Returns

a new Args[X].

def as[Y : Derivable]: Args[Y]

Convert this Args[X] to an Args[Y]. In practice, this method invokes map with the function deriveFrom invoked on the Derivable[Y] evidence.

Convert this Args[X] to an Args[Y]. In practice, this method invokes map with the function deriveFrom invoked on the Derivable[Y] evidence.

Type parameters

Y

the underlying type of the result, such that there is evidence of a Derivable[Y] provided implicitly.

Attributes

Returns

an Args[Y].

override def count(p: (Arg[X]) => Boolean): Int

Attributes

Definition Classes
IterableOnceOps
override def exists(p: (Arg[X]) => Boolean): Boolean

Attributes

Definition Classes
IterableOnceOps
override def filter(pred: (Arg[X]) => Boolean): Iterable[Arg[X]]

Attributes

Definition Classes
IterableOps -> IterableOnceOps
override def filterNot(pred: (Arg[X]) => Boolean): Iterable[Arg[X]]

Attributes

Definition Classes
IterableOps -> IterableOnceOps
override def find(p: (Arg[X]) => Boolean): Option[Arg[X]]

Attributes

Definition Classes
IterableOnceOps
def flatMap[Y](f: (Arg[X]) => Args[Y]): Args[Y]

Apply the given function f to each Arg of this Args

Apply the given function f to each Arg of this Args

Type parameters

Y

the result type of the function f

Value parameters

f

a function of type X => Args[Y]

Attributes

Returns

an Args[Y] object

override def forall(p: (Arg[X]) => Boolean): Boolean

Attributes

Definition Classes
IterableOnceOps
override def foreach[U](f: (Arg[X]) => U): Unit

Attributes

Definition Classes
IterableOnceOps
def getArg(w: String): Option[Arg[X]]

Method to get an Arg whose name matches the given string.

Method to get an Arg whose name matches the given string.

Value parameters

w

the string to match

Attributes

Returns

Some(arg) if the name matches, else None

def getArgValue(w: String): Option[X]

Get the arg value where the name matches the given string and where the resulting type is Y

Get the arg value where the name matches the given string and where the resulting type is Y

Value parameters

w

the string to match

Attributes

Returns

an option value of Y (None if there is no value).

def getArgValueAs[Y : Derivable](w: String): Option[Y]

Get the arg value where the name matches the given string and where the resulting type is Y

Get the arg value where the name matches the given string and where the resulting type is Y

Type parameters

Y

the result type

Value parameters

w

the string to match

Attributes

Returns

an option value of Y (None if toY yields a Failure)

def getArgValueEitherOr[Y : Derivable](w: String): Option[Either[X, Y]]

Get the arg value where the name matches the given string and where the resulting type is Y

Get the arg value where the name matches the given string and where the resulting type is Y

Value parameters

w

the string to match

Attributes

Returns

an option value of Y (None if there is no value).

override def head: Arg[X]

Attributes

Definition Classes
IterableOps
override def headOption: Option[Arg[X]]

Attributes

Definition Classes
IterableOps
def isDefined(w: String): Boolean

Method to determine if the argument identified by w is defined.

Method to determine if the argument identified by w is defined.

Value parameters

w

the name of an argument (flag).

Attributes

Returns

true if the argument is found by getArg

override def isEmpty: Boolean

Attributes

Definition Classes
IterableOnceOps
def iterator: Iterator[Arg[X]]
override def last: Arg[X]

Attributes

Definition Classes
IterableOps
override def lastOption: Option[Arg[X]]

Attributes

Definition Classes
IterableOps
def map[Y](f: (Arg[X]) => Arg[Y]): Args[Y]

Apply the given function f to each Arg of this Args

Apply the given function f to each Arg of this Args

Type parameters

Y

the result type of the function f

Value parameters

f

a function of type Arg[X] => Arg[Y]

Attributes

Returns

an Args[Y] object

def mapMap[Y](f: X => Y): Args[Y]

Apply the given map(f) to each Arg of this Args

Apply the given map(f) to each Arg of this Args

Type parameters

Y

the result type of the function f

Value parameters

f

a function of type X => Y

Attributes

Returns

an Args[Y] object

def mapOption[Y](f: X => Option[Y]): Args[Y]

Apply the given function f, using mapMap, to each Arg of this Args.

Apply the given function f, using mapMap, to each Arg of this Args.

Type parameters

Y

the result type of the function f

Value parameters

f

a function of type X => Option[Y]

Attributes

Returns

an Args[Y] object

def matchAndShift(f: PartialFunction[Arg[X], Unit]): Try[Args[X]]

Method to process one Arg and return the remainder of the arguments as an Args.

Method to process one Arg and return the remainder of the arguments as an Args.

Value parameters

f

a partially-defined function which can process the arg.

Attributes

Returns

a Success of the remainder if f is defined for the head Arg; a Failure(NoMatchException) if f is not defined for the head Arg; a Failure(EmptyArgsException) if this Args is empty.

def matchAndShiftOrElse(f: PartialFunction[Arg[X], Unit])(default: => Args[X]): Args[X]

Method to process one Arg and return the remainder of the arguments as an Args. In this form of the method, a failure to match by function f (including an empty Args) will result in the default value being returned, rather than a failure.

Method to process one Arg and return the remainder of the arguments as an Args. In this form of the method, a failure to match by function f (including an empty Args) will result in the default value being returned, rather than a failure.

Value parameters

default

a call-by-name value which will be returned in the event that matchAndShift does not succeed.

f

a partially-defined function which can process the arg.

Attributes

Returns

if f is defined for the Arg, then return the remainder; otherwise return the result of invoking default.

def operands(s: Synopsis): Map[String, X]

Get the operands (positional arguments) as a map of String->X pairs. This is achieved by matching up the names of operands from the synopsis (given) with the operands.

Get the operands (positional arguments) as a map of String->X pairs. This is achieved by matching up the names of operands from the synopsis (given) with the operands.

Value parameters

s

the synopsis from which we will derive the operand names.

Attributes

Returns

a map of String->X pairs.

def process(fm: Map[String, (Option[X]) => Unit]): Try[Seq[X]]

Process this Args according to the map fm of String->function.

Process this Args according to the map fm of String->function.

Value parameters

fm

a Map of String->function where function is of type Option[X]=>Unit

Attributes

Returns

a Try[Seq[X] resulting from iteration through each Arg and processing it.

override def size: Int

Attributes

Definition Classes
IterableOnceOps
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Iterable -> Any
def validate(w: String): Try[Args[X]]

Method to validate this Args according to the POSIX-style synopsis w, expressed as a String.

Method to validate this Args according to the POSIX-style synopsis w, expressed as a String.

Value parameters

w

the synopsis

Attributes

Returns

this Args, assuming that all is OK

def validate(sy: Try[Synopsis]): Try[Args[X]]

Method to validate this Args according to the (optional) synopsis given as sy.

Method to validate this Args according to the (optional) synopsis given as sy.

CONSIDER using lift CONSIDER using map/recover on sy

Value parameters

sy

the optional Synopsis, as produced by SynopsisParser.parseOptionalSynopsis.

Attributes

Returns

this, wrapped in Success, provided that no synopsis was given, or the synopsis was given and parsed successfully and the result of calling validate(Synopsis) is true. If a synopsis string was given but could not be parsed (a Failure other than the NoSuchElementException used by parseOptionalSynopsis to signal "no synopsis given"), that Failure is propagated rather than being silently treated as "nothing to validate".

Inherited methods

final def ++[B >: Arg[X]](suffix: IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
final def addString(b: StringBuilder): b.type

Attributes

Inherited from:
IterableOnceOps
final def addString(b: StringBuilder, sep: String): b.type

Attributes

Inherited from:
IterableOnceOps
def addString(b: StringBuilder, start: String, sep: String, end: String): b.type

Attributes

Inherited from:
IterableOnceOps
def collect[B](pf: PartialFunction[Arg[X], B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def collectFirst[B](pf: PartialFunction[Arg[X], B]): Option[B]

Attributes

Inherited from:
IterableOnceOps
def concat[B >: Arg[X]](suffix: IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def copyToArray[B >: Arg[X]](dest: Array[B], start: Int, n: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: Arg[X]](dest: Array[B], start: Int): Int

Attributes

Inherited from:
IterableOnceOps
def copyToArray[B >: Arg[X]](dest: Array[B]): Int

Attributes

Inherited from:
IterableOnceOps
def corresponds[B](that: IterableOnce[B])(p: (Arg[X], B) => Boolean): Boolean

Attributes

Inherited from:
IterableOnceOps
def drop(n: Int): Iterable[Arg[X]]

Attributes

Inherited from:
IterableOps
def dropRight(n: Int): Iterable[Arg[X]]

Attributes

Inherited from:
IterableOps
def dropWhile(p: (Arg[X]) => Boolean): Iterable[Arg[X]]

Attributes

Inherited from:
IterableOps
override def empty: Iterable[Arg[X]]

Attributes

Definition Classes
IterableFactoryDefaults -> IterableOps
Inherited from:
IterableFactoryDefaults
def flatMap[B](f: (Arg[X]) => IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def flatten[B](implicit asIterable: (Arg[X]) => IterableOnce[B]): Iterable[B]

Attributes

Inherited from:
IterableOps
def fold[A1 >: Arg[X]](z: A1)(op: (A1, A1) => A1): A1

Attributes

Inherited from:
IterableOnceOps
def foldLeft[B](z: B)(op: (B, Arg[X]) => B): B

Attributes

Inherited from:
IterableOnceOps
def foldRight[B](z: B)(op: (Arg[X], B) => B): B

Attributes

Inherited from:
IterableOnceOps
protected def fromSpecific(coll: IterableOnce[Arg[X]]): Iterable[Arg[X]]

Attributes

Inherited from:
IterableFactoryDefaults
def groupBy[K](f: (Arg[X]) => K): Map[K, Iterable[Arg[X]]]

Attributes

Inherited from:
IterableOps
def groupMap[K, B](key: (Arg[X]) => K)(f: (Arg[X]) => B): Map[K, Iterable[B]]

Attributes

Inherited from:
IterableOps
def groupMapReduce[K, B](key: (Arg[X]) => K)(f: (Arg[X]) => B)(reduce: (B, B) => B): Map[K, B]

Attributes

Inherited from:
IterableOps
def grouped(size: Int): Iterator[Iterable[Arg[X]]]

Attributes

Inherited from:
IterableOps
def init: Iterable[Arg[X]]

Attributes

Inherited from:
IterableOps
def inits: Iterator[Iterable[Arg[X]]]

Attributes

Inherited from:
IterableOps
override def isTraversableAgain: Boolean

Attributes

Definition Classes
IterableOps -> IterableOnceOps
Inherited from:
IterableOps
def iterableFactory: IterableFactory[Iterable]

Attributes

Inherited from:
Iterable
def knownSize: Int

Attributes

Inherited from:
IterableOnce
def lazyZip[B](that: Iterable[B]): LazyZip2[Arg[X], B, Iterable.this.type]

Attributes

Inherited from:
Iterable
def map[B](f: (Arg[X]) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def max[B >: Arg[X]](implicit ord: Ordering[B]): Arg[X]

Attributes

Inherited from:
IterableOnceOps
def maxBy[B](f: (Arg[X]) => B)(implicit ord: Ordering[B]): Arg[X]

Attributes

Inherited from:
IterableOnceOps
def maxByOption[B](f: (Arg[X]) => B)(implicit ord: Ordering[B]): Option[Arg[X]]

Attributes

Inherited from:
IterableOnceOps
def maxOption[B >: Arg[X]](implicit ord: Ordering[B]): Option[Arg[X]]

Attributes

Inherited from:
IterableOnceOps
def min[B >: Arg[X]](implicit ord: Ordering[B]): Arg[X]

Attributes

Inherited from:
IterableOnceOps
def minBy[B](f: (Arg[X]) => B)(implicit ord: Ordering[B]): Arg[X]

Attributes

Inherited from:
IterableOnceOps
def minByOption[B](f: (Arg[X]) => B)(implicit ord: Ordering[B]): Option[Arg[X]]

Attributes

Inherited from:
IterableOnceOps
def minOption[B >: Arg[X]](implicit ord: Ordering[B]): Option[Arg[X]]

Attributes

Inherited from:
IterableOnceOps
final def mkString: String

Attributes

Inherited from:
IterableOnceOps
final def mkString(sep: String): String

Attributes

Inherited from:
IterableOnceOps
final def mkString(start: String, sep: String, end: String): String

Attributes

Inherited from:
IterableOnceOps
protected def newSpecificBuilder: Builder[Arg[X], Iterable[Arg[X]]]

Attributes

Inherited from:
IterableFactoryDefaults
def nonEmpty: Boolean

Attributes

Inherited from:
IterableOnceOps
def partition(p: (Arg[X]) => Boolean): (Iterable[Arg[X]], Iterable[Arg[X]])

Attributes

Inherited from:
IterableOps
def partitionMap[A1, A2](f: (Arg[X]) => Either[A1, A2]): (Iterable[A1], Iterable[A2])

Attributes

Inherited from:
IterableOps
def product[B >: Arg[X]](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def reduce[B >: Arg[X]](op: (B, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeft[B >: Arg[X]](op: (B, Arg[X]) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeftOption[B >: Arg[X]](op: (B, Arg[X]) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceOption[B >: Arg[X]](op: (B, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceRight[B >: Arg[X]](op: (Arg[X], B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceRightOption[B >: Arg[X]](op: (Arg[X], B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
protected def reversed: Iterable[Arg[X]]

Attributes

Inherited from:
IterableOnceOps
def scan[B >: Arg[X]](z: B)(op: (B, B) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def scanLeft[B](z: B)(op: (B, Arg[X]) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def scanRight[B](z: B)(op: (Arg[X], B) => B): Iterable[B]

Attributes

Inherited from:
IterableOps
def sizeCompare(that: Iterable[_]): Int

Attributes

Inherited from:
IterableOps
def sizeCompare(otherSize: Int): Int

Attributes

Inherited from:
IterableOps
final def sizeIs: SizeCompareOps

Attributes

Inherited from:
IterableOps
def slice(from: Int, until: Int): Iterable[Arg[X]]

Attributes

Inherited from:
IterableOps
def sliding(size: Int, step: Int): Iterator[Iterable[Arg[X]]]

Attributes

Inherited from:
IterableOps
def sliding(size: Int): Iterator[Iterable[Arg[X]]]

Attributes

Inherited from:
IterableOps
def span(p: (Arg[X]) => Boolean): (Iterable[Arg[X]], Iterable[Arg[X]])

Attributes

Inherited from:
IterableOps
override def splitAt(n: Int): (Iterable[Arg[X]], Iterable[Arg[X]])

Attributes

Definition Classes
IterableOps -> IterableOnceOps
Inherited from:
IterableOps
def stepper[S <: Stepper[_]](implicit shape: StepperShape[Arg[X], S]): S

Attributes

Inherited from:
IterableOnce
def sum[B >: Arg[X]](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
def tail: Iterable[Arg[X]]

Attributes

Inherited from:
IterableOps
def tails: Iterator[Iterable[Arg[X]]]

Attributes

Inherited from:
IterableOps
def take(n: Int): Iterable[Arg[X]]

Attributes

Inherited from:
IterableOps
def takeRight(n: Int): Iterable[Arg[X]]

Attributes

Inherited from:
IterableOps
def takeWhile(p: (Arg[X]) => Boolean): Iterable[Arg[X]]

Attributes

Inherited from:
IterableOps
override def tapEach[U](f: (Arg[X]) => U): Iterable[Arg[X]]

Attributes

Definition Classes
IterableOps -> IterableOnceOps
Inherited from:
IterableOps
def to[C1](factory: Factory[Arg[X], C1]): C1

Attributes

Inherited from:
IterableOnceOps
def toArray[B >: Arg[X] : ClassTag]: Array[B]

Attributes

Inherited from:
IterableOnceOps
final def toBuffer[B >: Arg[X]]: Buffer[B]

Attributes

Inherited from:
IterableOnceOps
def toIndexedSeq: IndexedSeq[Arg[X]]

Attributes

Inherited from:
IterableOnceOps
def toList: List[Arg[X]]

Attributes

Inherited from:
IterableOnceOps
def toMap[K, V](implicit ev: Arg[X] <:< (K, V)): Map[K, V]

Attributes

Inherited from:
IterableOnceOps
def toSeq: Seq[Arg[X]]

Attributes

Inherited from:
IterableOnceOps
def toSet[B >: Arg[X]]: Set[B]

Attributes

Inherited from:
IterableOnceOps
def toVector: Vector[Arg[X]]

Attributes

Inherited from:
IterableOnceOps
def transpose[B](implicit asIterable: (Arg[X]) => Iterable[B]): Iterable[Iterable[B]]

Attributes

Inherited from:
IterableOps
def unzip[A1, A2](implicit asPair: (Arg[X]) => (A1, A2)): (Iterable[A1], Iterable[A2])

Attributes

Inherited from:
IterableOps
def unzip3[A1, A2, A3](implicit asTriple: (Arg[X]) => (A1, A2, A3)): (Iterable[A1], Iterable[A2], Iterable[A3])

Attributes

Inherited from:
IterableOps
def view: View[Arg[X]]

Attributes

Inherited from:
IterableOps
def withFilter(p: (Arg[X]) => Boolean): WithFilter[Arg[X], Iterable]

Attributes

Inherited from:
IterableOps
def zip[B](that: IterableOnce[B]): Iterable[(Arg[X], B)]

Attributes

Inherited from:
IterableOps
def zipAll[A1 >: Arg[X], B](that: Iterable[B], thisElem: A1, thatElem: B): Iterable[(A1, B)]

Attributes

Inherited from:
IterableOps
def zipWithIndex: Iterable[(Arg[X], Int)]

Attributes

Inherited from:
IterableOps

Deprecated and Inherited methods

def ++:[B >: Arg[X]](that: IterableOnce[B]): Iterable[B]

Attributes

Deprecated
[Since version 2.13.0] Use ++ instead of ++: for collections of type Iterable
Inherited from:
IterableOps
final def /:[B](z: B)(op: (B, Arg[X]) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from:
IterableOnceOps
final def :\[B](z: B)(op: (Arg[X], B) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from:
IterableOnceOps
def aggregate[B](z: => B)(seqop: (B, Arg[X]) => B, combop: (B, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] For sequential collections, prefer `foldLeft(z)(seqop)`. For parallel collections, use `ParIterableLike#aggregate`.
Inherited from:
IterableOnceOps
def companion: IterableFactory[Iterable]

Attributes

Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from:
IterableOps
final def copyToBuffer[B >: Arg[X]](dest: Buffer[B]): Unit

Attributes

Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from:
IterableOnceOps
def hasDefiniteSize: Boolean

Attributes

Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from:
IterableOnceOps
final def repr: Iterable[Arg[X]]

Attributes

Deprecated
[Since version 2.13.0] Use coll instead of repr in a collection implementation, use the collection value itself from the outside
Inherited from:
IterableOps
def seq: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.0] Iterable.seq always returns the iterable itself
Inherited from:
Iterable
final def toIterable: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.7] toIterable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
Iterable
final def toIterator: Iterator[Arg[X]]

Attributes

Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from:
IterableOnceOps
final def toStream: Stream[Arg[X]]

Attributes

Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from:
IterableOnceOps
final def toTraversable: Iterable[Arg[X]]

Attributes

Deprecated
[Since version 2.13.0] toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
IterableOps
def view(from: Int, until: Int): View[Arg[X]]

Attributes

Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Inherited from:
IterableOps

Concrete fields

lazy val operands: Seq[X]

Get the operands or positional arguments (i.e. args without names) as a sequence of X values.

Get the operands or positional arguments (i.e. args without names) as a sequence of X values.

Attributes

Returns

a sequence of X values.

lazy val options: Map[String, Option[X]]

Get the options (i.e. args with names) as map of names to (optional) values

Get the options (i.e. args with names) as map of names to (optional) values

Attributes

Returns

the options as a map