IOCaseApp

caseapp.catseffect.IOCaseApp
abstract class IOCaseApp[T](implicit val parser0: Parser[T], val messages: Help[T]) extends IOApp

Attributes

Graph
Supertypes
trait IOApp
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def run(options: T, remainingArgs: RemainingArgs): IO[ExitCode]

Concrete methods

def error(message: Error): IO[ExitCode]
def expandArgs(args: List[String]): List[String]

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 helpAsked: IO[ExitCode]
def ignoreUnrecognized: Boolean

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 nameFormatter: Formatter[Name]
def parser: Parser[T]
def println(x: String): IO[Unit]
override def run(args: List[String]): IO[ExitCode]

The entry point for your application. Will be called by the runtime when the process is started. If the underlying runtime supports it, any arguments passed to the process will be made available in the args parameter. The numeric value within the resulting ExitCode will be used as the exit code when the process terminates unless terminated exceptionally or by interrupt.

The entry point for your application. Will be called by the runtime when the process is started. If the underlying runtime supports it, any arguments passed to the process will be made available in the args parameter. The numeric value within the resulting ExitCode will be used as the exit code when the process terminates unless terminated exceptionally or by interrupt.

Value parameters

args

The arguments passed to the process, if supported by the underlying runtime. For example, java com.company.MyApp --foo --bar baz or node com-mycompany-fastopt.js --foo --bar baz would each result in List("--foo", "--bar", "baz").

Attributes

See also

IOApp.Simple!.run:cats\.effect\.IO[Unit]*

Definition Classes
IOApp

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: IO[ExitCode]

Inherited methods

final def main(args: Array[String]): Unit

Attributes

Inherited from:
IOApp

Defines what to do when IOApp detects that main is being invoked on a Thread which isn't the main process thread. This condition can happen when we are running inside of an sbt run with fork := false

Defines what to do when IOApp detects that main is being invoked on a Thread which isn't the main process thread. This condition can happen when we are running inside of an sbt run with fork := false

Attributes

Inherited from:
IOApp

Implicits

Implicits

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