Class CommandLine.RunAll

    • Constructor Detail

      • RunAll

        public RunAll()
    • 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 command and all subcommands as Runnable or Callable. If any of the CommandLine commands 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 the result of executing all commands: the return values from calling the Callable commands, null elements for commands that implement 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