Params

oxygen.cli.Params
See theParams companion trait
object Params

Attributes

Companion
trait
Experimental
true
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Params.type

Members list

Type members

Classlikes

final case class And[A, B, O](left: Params[A], right: Params[B], zip: Out[A, B, O]) extends Params[O]

Will attempt to parse left, and then right with the remaining args after parsing left. Both left and right must succeed in order for this parser to succeed.

Will attempt to parse left, and then right with the remaining args after parsing left. Both left and right must succeed in order for this parser to succeed.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[O]
trait Parser[O]
class Object
trait Matchable
class Any
Show all
final case class BooleanToggle(longName: BooleanLongName, shortName: Optional[BooleanShortName], aliases: List[BooleanName], hints: List[HelpHint]) extends Params[Boolean]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[Boolean]
trait Parser[Boolean]
class Object
trait Matchable
class Any
Show all
final case class Const[A](value: A) extends Params[A]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[A]
trait Parser[A]
class Object
trait Matchable
class Any
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait FinalParseResult[+A]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Fail
class Success[A]
final case class FirstOfByArgIndex[A](options: NonEmptyList[Params[A]]) extends Params[A]

Will take all parsers specified, each attempting to parse the remaining arguments. If none succeed, will return the errors from all parsers. If only one succeeds, will return the success of that parser. If multiple succeed, will return the first success order wise.

Will take all parsers specified, each attempting to parse the remaining arguments. If none succeed, will return the errors from all parsers. If only one succeeds, will return the success of that parser. If multiple succeed, will return the first success order wise.

Multi example: --key-1=value-1 --key-2=value-2 Both succeed with Key1("value-1") and Key2("value-2"). Key1("value-1") would be the success that is returned.

This is useful when you want to be able to parse an ADT, and have the results come back in a fixed order. In the above example, if you had 2 separate list parsers for key-1 and key-2, you would not know what order they were parsed in. But, if you combined them into an ADT, used Params.firstOf, and Params.repeated, then you would be able to know what order things were parsed in:

  • --key-1=value-1 --key-2=value-2 -> List(Key1("value-1"), Key2("value-2"))
  • --key-2=value-2 --key-1=value-1 -> List(Key2("value-2"), Key1("value-1"))

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[A]
trait Parser[A]
class Object
trait Matchable
class Any
Show all
final case class IfPresent[A](longName: LongName, shortName: Optional[ShortName], aliases: List[SimpleName], hints: List[HelpHint], value: A) extends Params[A]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[A]
trait Parser[A]
class Object
trait Matchable
class Any
Show all
case object Ignored extends Params[Unit]

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Params[Unit]
trait Parser[Unit]
class Object
trait Matchable
class Any
Show all
Self type
Ignored.type
final case class Mapped[A, B](parser: Params[A], f: A => B) extends Params[B]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[B]
trait Parser[B]
class Object
trait Matchable
class Any
Show all
final case class MappedOrFail[A, B](parser: Params[A], f: A => Either[String, B]) extends Params[B]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[B]
trait Parser[B]
class Object
trait Matchable
class Any
Show all
final case class Optional[A](parser: Params[A]) extends Params[Option[A]]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[Option[A]]
trait Parser[Option[A]]
class Object
trait Matchable
class Any
Show all
final case class Or[A](left: Params[A], right: Params[A]) extends Params[A]

Will attempt to parse left. If parsing left succeeds, parsing right will not be attempted, and this parser will succeed with left's success. If parsing left fails, parsing right will be attempted. If parsing right succeeds, this parser will succeed with right's success. If parsing right fails, this parser will fail with both the errors of left and right.

Will attempt to parse left. If parsing left succeeds, parsing right will not be attempted, and this parser will succeed with left's success. If parsing left fails, parsing right will be attempted. If parsing right succeeds, this parser will succeed with right's success. If parsing right fails, this parser will fail with both the errors of left and right.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[A]
trait Parser[A]
class Object
trait Matchable
class Any
Show all
final case class ParamWithValues[A](longName: LongName, shortName: Optional[ShortName], aliases: List[SimpleName], hints: List[HelpHint], valueParser: Values[A]) extends Params[A]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[A]
trait Parser[A]
class Object
trait Matchable
class Any
Show all
object ParseResult

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ParseResult[+A]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Fail
class Success[A]
final case class ParsedParams

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ParsedParams

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class Raw(name: LongName, hints: List[HelpHint]) extends Params[ParamLike]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[ParamLike]
trait Parser[ParamLike]
class Object
trait Matchable
class Any
Show all
final case class Repeated[A](parser: Params[A]) extends Params[List[A]]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[List[A]]
trait Parser[List[A]]
class Object
trait Matchable
class Any
Show all
final case class RepeatedNel[A](parser: Params[A]) extends Params[NonEmptyList[A]]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[NonEmptyList[A]]
trait Parser[NonEmptyList[A]]
class Object
trait Matchable
class Any
Show all
final case class WithDefault[A](parser: Params[A], default: A) extends Params[A]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Params[A]
trait Parser[A]
class Object
trait Matchable
class Any
Show all
object toggle

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
toggle.type

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 enum[A <: Enum[LazyRef(...)]](longName: LongName, shortName: Optional[ShortName], aliases: List[SimpleName], hints: List[Make])(implicit ehc: HasCompanion[A]): Params[A]
def findParam(names: Set[SimpleName], params: List[ParamLike]): Option[(ParamLike, List[ParamLike])]
def findParamTagged[A](names: Map[SimpleName, A], params: List[ParamLike]): Option[(ParamLike, A, List[ParamLike])]
def firstOf[A](parser0: Params[A], parser1: Params[A], parserN: Params[A]*): Params[A]

Attributes

See also
def flag(longName: LongName, value: Boolean, shortName: Optional[ShortName], aliases: List[SimpleName], hints: List[Make]): Params[Boolean]
def ifPresent[A](longName: LongName, value: A, shortName: Optional[ShortName], aliases: List[SimpleName], hints: List[Make]): Params[A]
def value[A : StringDecoder](longName: LongName, shortName: Optional[ShortName], aliases: List[SimpleName], hints: List[Make]): Params[A]
def valueWith[A](longName: LongName, shortName: Optional[ShortName], aliases: List[SimpleName], hints: List[Make])(valueParser: Values[A]): Params[A]