Class CommandLine.RunFirst

    • Constructor Detail

      • RunFirst

        public RunFirst()
    • Method Detail

      • handleParseResult

        public List<Object> handleParseResult​(List<CommandLine> parsedCommands,
                                              PrintStream out,
                                              CommandLine.Help.Ansi ansi)
        Prints help if requested, and otherwise executes the top-level Runnable or Callable command. If the top-level command does not implement either Runnable or Callable, a ExecutionException is thrown detailing the problem and capturing the offending CommandLine object.
        Specified by:
        handleParseResult in interface CommandLine.IParseResultHandler
        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:
        an empty list if help was requested, or a list containing a single element: the result of calling the Callable, or a null element if the top-level command was a Runnable
        Throws:
        CommandLine.ExecutionException - if a problem occurred while processing the parse results; use CommandLine.ExecutionException.getCommandLine() to get the command or subcommand where processing failed