Args

com.phasmidsoftware.args.Args
See theArgs companion class
object Args

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Args.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def create(args: Arg[String]*): Args[String]

Method to create an Args object from a variable number of Arg parameters.

Method to create an Args object from a variable number of Arg parameters.

NOTE: this is normally used only for testing.

Value parameters

args

the command line arguments.

Attributes

Returns

the arguments parsed as an Args[String].

def empty[T]: Args[T]

Method to create an empty Args.

Method to create an empty Args.

Type parameters

T

the underlying type of the result.

Attributes

Returns

an Args[T].

def make(args: Array[String]): Args[String]

Method to create an Args[String] from the command line arguments in a main program (or a sub-class of App). This method is only appropriate for unit testing.

Method to create an Args[String] from the command line arguments in a main program (or a sub-class of App). This method is only appropriate for unit testing.

NOTE: we use get here on a Try. We might throw an exception, therefore.

Value parameters

args

an Array[String].

Attributes

Returns

an Args[String]

Throws
Exception

the result of invoking parse.

def parse(args: Array[String], synopsis: Option[String] = ..., optionalProgramName: Option[String] = ..., validate: Boolean = ...): Try[Args[String]]

Method to parse a set of command line arguments that conform to the POSIX standard.

Method to parse a set of command line arguments that conform to the POSIX standard.

Value parameters

args

the command line arguments.

optionalProgramName

if optionalProgramName is defined, the args array will be written to the Error Output, prefixed by the program name.

synopsis

the (optional) syntax template which will be used, if not None, to validate the options.

validate

if true (the default), the parsed result is validated against synopsis (mandatory options and operand arity) before being returned; if false, synopsis is still used to guide flag/value pairing during parsing, but the caller is responsible for invoking validate explicitly afterwards.

Attributes

Returns

the arguments parsed as an Args[String], wrapped in Try.

def parseSimple(args: Array[String]): Try[Args[String]]

Method to parse a set of command line arguments that don't necessarily conform to the POSIX standard, and which cannot be validated.

Method to parse a set of command line arguments that don't necessarily conform to the POSIX standard, and which cannot be validated.

Value parameters

args

the command line arguments.

Attributes

Returns

the arguments parsed as an Args[String], wrapped in Try.

def showArgs(args: Array[String]): String
def singleton[T](ta: Arg[T]): Args[T]

Method to create a singleton Args.

Method to create a singleton Args.

Type parameters

T

the underlying type of ta, and the result.

Value parameters

ta

an Arg[T].

Attributes

Returns

an Args[T].

Deprecated methods

def make(args: IndexedSeq[String]): Args[String]

Method to create an Args[String] from an IndexedSeq of Args. This method is only appropriate for unit testing and is now deprecated.

Method to create an Args[String] from an IndexedSeq of Args. This method is only appropriate for unit testing and is now deprecated.

NOTE: we use get here on a Try. We might throw an exception, therefore.

Value parameters

args

an IndexedSeq[String].

Attributes

Returns

an Args[String]

Throws
Exception

the result of invoking parse.

Deprecated
true