CaseApp

caseapp.core.app.CaseApp
See theCaseApp companion object
abstract class CaseApp[T](implicit val parser0: Parser[T], val messages: Help[T])

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Command[T]

Members list

Concise view

Value members

Abstract methods

def run(options: T, remainingArgs: RemainingArgs): Unit

Concrete methods

def complete(args: Seq[String], index: Int): List[CompletionItem]
def error(message: Error): Nothing
def exit(code: Int): Nothing

Arguments are expanded then parsed. By default, argument expansion is the identity function. Overriding this method allows plugging in an arbitrary argument expansion logic.

Arguments are expanded then parsed. By default, argument expansion is the identity function. Overriding this method allows plugging in an arbitrary argument expansion logic.

One such expansion logic involves replacing each argument of the form '@' with the contents of that file where each line in the file becomes a distinct argument. To enable this behavior, override this method as shown below.

Attributes

Example:
import caseapp.core.parser.PlatformArgsExpander
override def expandArgs(args: List[String]): List[String]
= PlatformArgsExpander.expand(args)
def fullHelpAsked(progName: String): Nothing
def helpAsked(progName: String, maybeOptions: Either[Error, T]): Nothing

Whether to ignore unrecognized arguments.

Whether to ignore unrecognized arguments.

That is, if there are unrecognized arguments, the parsing still succeeds. The unparsed arguments are put in the args argument of run.

Attributes

def main(args: Array[String]): Unit
def main(progName: String, args: Array[String]): Unit
def parser: Parser[T]

Whether to stop parsing at the first unrecognized argument.

Whether to stop parsing at the first unrecognized argument.

That is, stop parsing at the first non option (not starting with "-"), or the first unrecognized option. The unparsed arguments are put in the args argument of run.

Attributes

def usageAsked(progName: String, maybeOptions: Either[Error, T]): Nothing

Concrete fields

lazy val finalHelp: Help[_]

Implicits

Implicits

implicit val messages: Help[T]
implicit val parser0: Parser[T]