Class CommandLine.RunAll

    • Constructor Summary

      Constructors 
      Constructor Description
      RunAll()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.Object> handleParseResult​(java.util.List<CommandLine> parsedCommands, java.io.PrintStream out, CommandLine.Help.Ansi ansi)
      Prints help if requested, and otherwise executes the top-level command and all subcommands as Runnable or Callable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RunAll

        public RunAll()
    • Method Detail

      • handleParseResult

        public java.util.List<java.lang.Object> handleParseResult​(java.util.List<CommandLine> parsedCommands,
                                                                  java.io.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