Reader

@implicitNotFound("No Reader[${A}] found. A reader is required to parse a command line argument from a string to a ${A}. ".+("Please define a Reader[${A}]."))
trait Reader[A]

A typeclass that defines how to convert a string from a single command line argument to a given type.

Companion:
object
class Object
trait Matchable
class Any
object BooleanReader.type
object DoubleReader.type
object DurationReader.type
object FloatReader.type
trait FsPathReader[A]
object FilePathReader.type
object JavaFileReader.type
object JavaPathReader.type
object PathReader.type
object RelPathReader.type
object SubPathReader.type
object InputStreamReader.type
object InstantReader.type
object LocalDateReader.type
object LocalTime.type
object OutputStreamReader.type
object RangeReader.type
object ReadableReader.type

Value members

Abstract methods

def read(a: String): Result[A]

Either convert the string to A or return a failure message.

Either convert the string to A or return a failure message.

Do not throw from a reader, as it will cause the argument parser to crash, leading to a horrible user experience.

def typeName: String

The human-friendly name of this reader's argument type.

The human-friendly name of this reader's argument type.

Concrete methods

def interactiveCompleter: String => Seq[String]

Compute available shell completions starting with a given string. This is used by interactive bash completion, where the user program is responsible for generating completions.

Compute available shell completions starting with a given string. This is used by interactive bash completion, where the user program is responsible for generating completions.

A completer for bash. This is used by standalone bash completion, where a bash script generates completion, without the involvement of the the user program.

A completer for bash. This is used by standalone bash completion, where a bash script generates completion, without the involvement of the the user program.

If your program is running on the JVM, the startup time is considerable and hence standalone completion should be preferred to interactive completion for a snappy user experience.