mainargs

package mainargs

Type members

Classlikes

object ArgSig
Companion:
class
case class ArgSig(name: Option[String], shortName: Option[Char], doc: Option[String], default: Option[Any => Any], reader: TokensReader[_], positional: Boolean, hidden: Boolean)

Models what is known by the router about a single argument: that it has a name, a human-readable typeString describing what the type is (just for logging and reading, not a replacement for a TypeTag) and possible a function that can compute its default value

Models what is known by the router about a single argument: that it has a name, a human-readable typeString describing what the type is (just for logging and reading, not a replacement for a TypeTag) and possible a function that can compute its default value

Companion:
object
object Compat
case class Flag(value: Boolean)
object Invoker
case class Leftover[T](value: T*)
object Macros
case class MainData[T, B](name: String, argSigs0: Seq[ArgSig], doc: Option[String], invokeRaw: (B, Seq[Any]) => T)

What is known about a single endpoint for our routes. It has a name, flattenedArgSigs for each argument, and a macro-generated invoke0 that performs all the necessary argument parsing and de-serialization.

What is known about a single endpoint for our routes. It has a name, flattenedArgSigs for each argument, and a macro-generated invoke0 that performs all the necessary argument parsing and de-serialization.

Realistically, you will probably spend most of your time calling Invoker.invoke instead, which provides a nicer API to call it that mimmicks the API of calling a Scala method.

Companion:
object
object MainData
Companion:
class
case class MethodMains[B](value: Seq[MainData[Any, B]], base: () => B)
sealed trait ParamResult[+T]
Companion:
object
Companion:
class
Companion:
class
class ParserForClass[T](val main: MainData[T, Any], val companion: () => Any) extends Class[T]
Companion:
object
Companion:
class
class ParserForMethods[B](val mains: MethodMains[B])
Companion:
object
object Renderer
sealed trait Result[+T]

Represents what comes out of an attempt to invoke an Main. Could succeed with a value, but could fail in many different ways.

Represents what comes out of an attempt to invoke an Main. Could succeed with a value, but could fail in many different ways.

Companion:
object
object Result
Companion:
class
case class TokenGrouping[B](remaining: List[String], grouped: Map[ArgSig, Seq[String]])
Companion:
object
Companion:
class
sealed trait TokensReader[T]

Represents the ability to parse CLI input arguments into a type T

Represents the ability to parse CLI input arguments into a type T

Has a fixed number of direct subtypes - Simple, Constant, Flag, Leftover, and Class - but each of those can be extended by an arbitrary number of user-specified instances.

Companion:
object
Companion:
class
object Util
class arg(val name: String, val short: Char, val doc: String, val noDefaultName: Boolean, val positional: Boolean, val hidden: Boolean) extends ClassfileAnnotation
class main(val name: String, val doc: String) extends ClassfileAnnotation