Skip to content

Package io.github.qishr.cascara.common.util

Interface IParseResultHandler

java.lang.Object
        io.github.qishr.cascara.common.util.CommandLine.IParseResultHandler

Enclosing Class:
    io.github.qishr.cascara.common.util.CommandLine

All Known Implementing Classes:
    RunFirst, RunLast, RunAll


public static interface IParseResultHandler

Represents a function that can process a List of CommandLine objects resulting from successfully parsing the command line arguments.This is a functional interface whose functional method is handleParseResult.

Implementations of this functions can be passed to the #parseWithHandlers(IParseResultHandler, PrintStream, Help.Ansi, IExceptionHandler, String...) methods to take some next step after the command line was successfully parsed.

Method Summary

Modifier and Type Method Description
public abstract List<Object> handleParseResult(List<CommandLine> parsedCommands, PrintStream out, Ansi ansi) Processes a List of CommandLine objects resulting from successfully parsing the command line arguments and optionally returns a list of results.

Method Details

handleParseResult

public abstract List<Object> handleParseResult(List<CommandLine> parsedCommands, PrintStream out, Ansi ansi)

Processes a List of CommandLine objects resulting from successfully parsing the command line arguments and optionally returns a list of results.

Parameters:

parsedCommands - the CommandLine objects that resulted from successfully parsing the command line arguments

out - the PrintStream to print help to if requested

ansi - for printing help messages using ANSI styles and colors

Returns:

a list of results, or an empty list if there are no results

Throws:

ExecutionException