optparse_applicative

Type members

Inherited classlikes

trait ArgsState[F[_]]
Inherited from
Common

Types

type Parser[A] = Parser[A]
type ParserInfo[A] = ParserInfo[A]

Inherited types

type InfoMod[A] = Endo[ParserInfo[A]]
Inherited from
Builder
type PrefsMod = Endo[ParserPrefs]
Inherited from
Builder

Value members

Inherited methods

def abortOption[A](err: ParseError, mod: Mod[[A] =>> OptionFields[A], A => A]*): Parser[A => A]

An option that always fails.

An option that always fails.

Inherited from
Builder
def argMatches[F[_], A](opt: OptReader[A], arg: String)(implicit F: MonadP[F]): Option[StateT[Args, F, A]]
Inherited from
Common
def argument[A](p: ReadM[A], mod: Mod[[A] =>> ArgumentFields[A], A]*): Parser[A]

Builder for an argument parser.

Builder for an argument parser.

Inherited from
Builder
def bigDecimalArgument(mod: Mod[[A] =>> ArgumentFields[A], BigDecimal]*): Parser[BigDecimal]

Builder for a BigDecimal argument.

Builder for a BigDecimal argument.

Inherited from
Builder
def bigDecimalOption(mod: Mod[[A] =>> OptionFields[A], BigDecimal]*): Parser[BigDecimal]

Builder for an option taking a BigDecimal argument.

Builder for an option taking a BigDecimal argument.

Inherited from
Builder
def bigIntArgument(mod: Mod[[A] =>> ArgumentFields[A], BigInt]*): Parser[BigInt]

Builder for a BigInt argument.

Builder for a BigInt argument.

Inherited from
Builder
def bigIntOption(mod: Mod[[A] =>> OptionFields[A], BigInt]*): Parser[BigInt]

Builder for an option taking a BigInt argument.

Builder for an option taking a BigInt argument.

Inherited from
Builder
def bodyHelp(chunk: Chunk[Doc]): ParserHelp
Inherited from
Help
def briefDesc[A](pprefs: ParserPrefs, parser: Parser[A]): Chunk[Doc]

Generate a brief help text for a parser.

Generate a brief help text for a parser.

Inherited from
Help
def byteArgument(mod: Mod[[A] =>> ArgumentFields[A], Byte]*): Parser[Byte]

Builder for a Byte argument.

Builder for a Byte argument.

Inherited from
Builder
def byteOption(mod: Mod[[A] =>> OptionFields[A], Byte]*): Parser[Byte]

Builder for an option taking a Byte argument.

Builder for an option taking a Byte argument.

Inherited from
Builder
def charArgument(mod: Mod[[A] =>> ArgumentFields[A], Char]*): Parser[Char]

Builder for a Char argument.

Builder for a Char argument.

Inherited from
Builder
def charOption(mod: Mod[[A] =>> OptionFields[A], Char]*): Parser[Char]

Builder for an option taking a Char argument.

Builder for an option taking a Char argument.

Inherited from
Builder
def cmdDesc[A](p: Parser[A]): Chunk[Doc]

Generate descriptions for commands.

Generate descriptions for commands.

Inherited from
Help
def columns(cols: Int): PrefsMod
Inherited from
Builder
def command[A](cmd: String, info: ParserInfo[A]): Mod[[A] =>> CommandFields[A], A]

Add a command to a subparser option.

Add a command to a subparser option.

Inherited from
Builder
def customExecParser[A](args: List[String], progName: String, pprefs: ParserPrefs, pinfo: ParserInfo[A]): A
Inherited from
Extra
def disabled[A]: ReadM[A]

Null Option reader. All arguments will fail validation.

Null Option reader. All arguments will fail validation.

Inherited from
Builder
def doubleArgument(mod: Mod[[A] =>> ArgumentFields[A], Double]*): Parser[Double]

Builder for a Double argument.

Builder for a Double argument.

Inherited from
Builder
def doubleOption(mod: Mod[[A] =>> OptionFields[A], Double]*): Parser[Double]

Builder for an option taking a Double argument.

Builder for an option taking a Double argument.

Inherited from
Builder
def eitherReader[A](f: String => String \/ A): ReadM[A]

Convert a function in the Either monad to a reader.

Convert a function in the Either monad to a reader.

Inherited from
Builder
def errorHelp(chunk: Chunk[Doc]): ParserHelp
Inherited from
Help
def evalParser[A](p: Parser[A]): Option[A]

The default value of a Parser. This function returns an error if any of the options don't have a default value

The default value of a Parser. This function returns an error if any of the options don't have a default value

Inherited from
Common
def execParser[A](args: Array[String], progName: String, pinfo: ParserInfo[A]): A
Inherited from
Extra
def execParserPure[A](pprefs: ParserPrefs, pinfo: ParserInfo[A], args: List[String]): ParserResult[A]
Inherited from
Extra
def failureCode[A](code: Int): InfoMod[A]
Inherited from
Builder
def flag[A](defV: A, actV: A, mod: Mod[[A] =>> FlagFields[A], A]*): Parser[A]

Builder for a flag parser.

Builder for a flag parser.

Inherited from
Builder
def flag_[A](actV: A, mod: Mod[[A] =>> FlagFields[A], A]*): Parser[A]

Builder for a flag parser without a default value.

Builder for a flag parser without a default value.

Inherited from
Builder
def floatArgument(mod: Mod[[A] =>> ArgumentFields[A], Float]*): Parser[Float]

Builder for a Float argument.

Builder for a Float argument.

Inherited from
Builder
def floatOption(mod: Mod[[A] =>> OptionFields[A], Float]*): Parser[Float]

Builder for an option taking a Float argument.

Builder for an option taking a Float argument.

Inherited from
Builder
def footerDoc[A](doc: Option[Doc]): InfoMod[A]
Inherited from
Builder
Inherited from
Help
def fromTryCatch[A](f: String => A): ReadM[A]

Turns an unsafe conversion function into a reader by catching non-fatal exceptions.

Turns an unsafe conversion function into a reader by catching non-fatal exceptions.

Inherited from
Builder
def fullDesc[A](pprefs: ParserPrefs, parser: Parser[A]): Chunk[Doc]

Generate a full help text for a parser.

Generate a full help text for a parser.

Inherited from
Help
Inherited from
Common
def handleParseResult[A](progName: String, result: ParserResult[A]): A
Inherited from
Extra
def header[A](header: String): InfoMod[A]
Inherited from
Builder
def headerDoc[A](doc: Option[Doc]): InfoMod[A]
Inherited from
Builder
Inherited from
Help
def help[F[_], A](s: String): Mod[F, A]

Specify the help text for an option.

Specify the help text for an option.

Inherited from
Builder
def helpDoc[F[_], A](doc: Option[Doc]): Mod[F, A]

Specify the help Doc.

Specify the help Doc.

Inherited from
Builder
def helper[A]: Parser[A => A]

A hidden "helper" option which always fails

A hidden "helper" option which always fails

Inherited from
Extra
def hidden[F[_], A]: Mod[F, A]

Hide this option from the brief description.

Hide this option from the brief description.

Inherited from
Builder
def idm[M](implicit M: Monoid[M]): M

Trivial option modifier.

Trivial option modifier.

Inherited from
Builder
def info[A](parser: Parser[A], mod: InfoMod[A]*): ParserInfo[A]
Inherited from
Builder
def infoOption[A](s: String, mod: Mod[[A] =>> OptionFields[A], A => A]*): Parser[A => A]

An option that always fails and displays a message.

An option that always fails and displays a message.

Inherited from
Builder
def intArgument(mod: Mod[[A] =>> ArgumentFields[A], Int]*): Parser[Int]

Builder for a Int argument.

Builder for a Int argument.

Inherited from
Builder
def intOption(mod: Mod[[A] =>> OptionFields[A], Int]*): Parser[Int]

Builder for an option taking a Int argument.

Builder for an option taking a Int argument.

Inherited from
Builder
def isArg[A](r: OptReader[A]): Boolean
Inherited from
Common
def isOptionPrefix(n1: OptName, n2: OptName): Boolean
Inherited from
Common
def liftOpt[A](opt: Opt[A]): Parser[A]

Create a parser composed of a single operation.

Create a parser composed of a single operation.

Inherited from
Common
def long[F[_], A](s: String)(implicit F: HasName[F]): Mod[F, A]

Specify a long name for an option.

Specify a long name for an option.

Inherited from
Builder
def longArgument(mod: Mod[[A] =>> ArgumentFields[A], Long]*): Parser[Long]

Builder for a Long argument.

Builder for a Long argument.

Inherited from
Builder
def longOption(mod: Mod[[A] =>> OptionFields[A], Long]*): Parser[Long]

Builder for an option taking a Long argument.

Builder for an option taking a Long argument.

Inherited from
Builder
def many[A](p: Parser[A]): Parser[List[A]]
Inherited from
ParserFunctions
def mapParser[A, B](f: OptHelpInfo => NaturalTransformation[[A] =>> Opt[A], [_] =>> Const[B, _$23]], p: Parser[A]): List[B]

Map a polymorphic function over all the options of a parser, and collect the results in a list.

Map a polymorphic function over all the options of a parser, and collect the results in a list.

Inherited from
Common
def metavar[F[_], A](v: String): Mod[F, A]

Specify a metavariable for the argument.

Specify a metavariable for the argument.

Metavariables have no effect on the parser, and only serve to specify the symbolic name for an argument to be displayed in the help text.

Inherited from
Builder
def multiSuffix(suffix: String): PrefsMod
Inherited from
Builder
def noArgError[A](e: ParseError): Mod[[A] =>> OptionFields[A], A]

Specify the error to display when no argument is provided to this option.

Specify the error to display when no argument is provided to this option.

Inherited from
Builder
def noIntersperse[A]: InfoMod[A]
Inherited from
Builder
def optDesc[A](pprefs: ParserPrefs, style: OptDescStyle, info: OptHelpInfo, opt: Opt[A]): Chunk[Doc]

Generate description for a single option.

Generate description for a single option.

Inherited from
Help
def optMatches[F[_], A](disambiguate: Boolean, opt: OptReader[A], word: OptWord)(implicit F: MonadP[F]): Option[StateT[Args, F, A]]
Inherited from
Common
def option[A](r: ReadM[A], mod: Mod[[A] =>> OptionFields[A], A]*): Parser[A]
Inherited from
Builder
def optional[A](p: Parser[A]): Parser[Option[A]]
Inherited from
ParserFunctions
def parseError[F[_], A](arg: String)(implicit F: MonadP[F]): F[A]
Inherited from
Common
def parseWord(s: String): Option[OptWord]
Inherited from
Common

Generate a ParserFailure from a ParseError in a given Context.

Generate a ParserFailure from a ParseError in a given Context.

Inherited from
Extra
def parserHelp[A](pprefs: ParserPrefs, parser: Parser[A]): ParserHelp

Generate the help text for a program.

Generate the help text for a program.

Inherited from
Help
def parserUsage[A](pprefs: ParserPrefs, parser: Parser[A], progName: String): Doc

Generate option summary.

Generate option summary.

Inherited from
Help
def prefs(mod: PrefsMod*): ParserPrefs
Inherited from
Builder
def progDesc[A](desc: String): InfoMod[A]

Specify a short program description.

Specify a short program description.

Inherited from
Builder
def progDescDoc[A](doc: Option[Doc]): InfoMod[A]
Inherited from
Builder
def pure[A](a: A): Parser[A]
Inherited from
ParserFunctions
def renderFailure(failure: ParserFailure[ParserHelp], progName: String): (String, ExitCode)
Inherited from
Extra
def runParser[F[_], A](policy: ArgPolicy, p: Parser[A], args: Args)(implicit F: MonadP[F]): F[(Args, A)]

Apply a Parser to a command line, and return a result and leftover arguments. This function returns an error if any parsing error occurs, or if any options are missing and don't have a default value.

Apply a Parser to a command line, and return a result and leftover arguments. This function returns an error if any parsing error occurs, or if any options are missing and don't have a default value.

Inherited from
Common
def runParserFully[F[_], A](policy: ArgPolicy, p: Parser[A], args: Args)(implicit evidence$7: MonadP[F]): F[A]
Inherited from
Common
def runParserInfo[F[_], A](i: ParserInfo[A], args: Args)(implicit evidence$6: MonadP[F]): F[A]
Inherited from
Common
def searchArg[F[_], A](arg: String, p: Parser[A])(implicit evidence$4: MonadP[F]): NondetT[G, Parser[A]]
Inherited from
Common
def searchOpt[F[_], A](pprefs: ParserPrefs, w: OptWord, p: Parser[A])(implicit evidence$3: MonadP[F]): NondetT[G, Parser[A]]
Inherited from
Common
def searchParser[F[_], A](f: NaturalTransformation[[A] =>> Opt[A], [_] =>> NondetT[F, _$17]], p: Parser[A])(implicit evidence$2: Monad[F]): NondetT[F, Parser[A]]
Inherited from
Common
def short[F[_], A](c: Char)(implicit F: HasName[F]): Mod[F, A]

Specify a short name for an option.

Specify a short name for an option.

Inherited from
Builder
def shortArgument(mod: Mod[[A] =>> ArgumentFields[A], Short]*): Parser[Short]

Builder for a Short argument.

Builder for a Short argument.

Inherited from
Builder
def shortOption(mod: Mod[[A] =>> OptionFields[A], Short]*): Parser[Short]

Builder for an option taking a Short argument.

Builder for an option taking a Short argument.

Inherited from
Builder
def showDefault[F[_], A](implicit A: Show[A]): Mod[F, A]

Show the default value for this option using its Show instance.

Show the default value for this option using its Show instance.

Inherited from
Builder
def showDefaultWith[F[_], A](f: A => String): Mod[F, A]

Specify a function to show the default value for an option.

Specify a function to show the default value for an option.

Inherited from
Builder
def showOption(name: OptName): String
Inherited from
Common
def simplify[A](as: OptTree[A]): OptTree[A]
Inherited from
Common
def some[A](p: Parser[A]): Parser[NonEmptyList[A]]
Inherited from
ParserFunctions
def stepParser[F[_], A](pprefs: ParserPrefs, policy: ArgPolicy, arg: String, p: Parser[A])(implicit evidence$5: MonadP[F]): NondetT[G, Parser[A]]
Inherited from
Common
def strArgument(mod: Mod[[A] =>> ArgumentFields[A], String]*): Parser[String]

Builder for a String argument.

Builder for a String argument.

Inherited from
Builder
def strOption(mod: Mod[[A] =>> OptionFields[A], String]*): Parser[String]

Builder for an option taking a String argument.

Builder for an option taking a String argument.

Inherited from
Builder
def subparser[A](mod: Mod[[A] =>> CommandFields[A], A]*): Parser[A]

Builder for a command parser. The command modifier can be used to specify individual commands.

Builder for a command parser. The command modifier can be used to specify individual commands.

Inherited from
Builder
def switch(mod: Mod[[A] =>> FlagFields[A], Boolean]*): Parser[Boolean]

Builder for a boolean flag.

Builder for a boolean flag.

Inherited from
Builder
def treeMapParser[A, B](g: OptHelpInfo => NaturalTransformation[[A] =>> Opt[A], [_] =>> Const[B, _$24]], p: Parser[A]): OptTree[B]

Like mapParser, but collect the results in a tree structure.

Like mapParser, but collect the results in a tree structure.

Inherited from
Common
def usageHelp(chunk: Chunk[Doc]): ParserHelp
Inherited from
Help
def value[F[_], A](a: A): Mod[F, A]

Specify a default value for an option.

Specify a default value for an option.

Inherited from
Builder

Inherited fields

val disambiguate: PrefsMod
Inherited from
Builder
val noBacktrack: PrefsMod
Inherited from
Builder
val readBigDecimal: ReadM[BigDecimal]

BigDecimal reader

BigDecimal reader

Inherited from
Builder
val readBigInt: ReadM[BigInt]

BigInt reader

BigInt reader

Inherited from
Builder
val readByte: ReadM[Byte]

Byte reader

Byte reader

Inherited from
Builder
val readChar: ReadM[Char]

Char reader

Char reader

Inherited from
Builder
val readDouble: ReadM[Double]

Double reader

Double reader

Inherited from
Builder
val readFloat: ReadM[Float]

Float reader

Float reader

Inherited from
Builder
val readInt: ReadM[Int]

Int reader.

Int reader.

Inherited from
Builder
val readLong: ReadM[Long]

Long reader

Long reader

Inherited from
Builder
val readShort: ReadM[Short]

Short reader

Short reader

Inherited from
Builder
val readStr: ReadM[String]

String reader.

String reader.

Inherited from
Builder
val showHelpOnError: PrefsMod
Inherited from
Builder