diff --git a/README.md b/README.md index c180cf65..7a039db7 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Picocli-based applications can easily [integrate](https://picocli.info/#_depende ### Releases * [All Releases](https://github.com/remkop/picocli/releases) -* Latest: 4.0.0-alpha-2 [Release Notes](https://github.com/remkop/picocli/releases/tag/v4.0.0-alpha-2) +* Latest: 4.0.0-alpha-3 [Release Notes](https://github.com/remkop/picocli/releases/tag/v4.0.0-alpha-3) * Stable: Picocli 3.9.6 [Release Notes](https://github.com/remkop/picocli/releases/tag/v3.9.6) * Older: Picocli 3.0.0 [Release Notes](https://github.com/remkop/picocli/releases/tag/v3.0.0) * Older: Picocli 2.0 [Release Notes](https://github.com/remkop/picocli/releases/tag/v2.0.0) @@ -199,35 +199,35 @@ See the [source code](https://github.com/remkop/picocli/blob/master/src/main/jav ### Gradle ``` -compile 'info.picocli:picocli:4.0.0-alpha-2' +compile 'info.picocli:picocli:4.0.0-alpha-3' ``` ### Maven ``` info.picocli picocli - 4.0.0-alpha-2 + 4.0.0-alpha-3 ``` ### Scala SBT ``` -libraryDependencies += "info.picocli" % "picocli" % "4.0.0-alpha-2" +libraryDependencies += "info.picocli" % "picocli" % "4.0.0-alpha-3" ``` ### Ivy ``` - + ``` ### Grape ```groovy @Grapes( - @Grab(group='info.picocli', module='picocli', version='4.0.0-alpha-2') + @Grab(group='info.picocli', module='picocli', version='4.0.0-alpha-3') ) ``` ### Leiningen ``` -[info.picocli/picocli "4.0.0-alpha-2"] +[info.picocli/picocli "4.0.0-alpha-3"] ``` ### Buildr ``` -'info.picocli:picocli:jar:4.0.0-alpha-2' +'info.picocli:picocli:jar:4.0.0-alpha-3' ``` diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index fecc2722..5a32c6f1 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,7 +1,7 @@ # picocli Release Notes -# Picocli 4.0.0-alpha-3 (UNRELEASED) +# Picocli 4.0.0-alpha-3 The picocli community is pleased to announce picocli 4.0.0-alpha-3. This release adds improved support for command execution via the new `execute` method. diff --git a/docs/apidocs/allclasses-frame.html b/docs/apidocs/allclasses-frame.html index a83fd55c..73e779b7 100644 --- a/docs/apidocs/allclasses-frame.html +++ b/docs/apidocs/allclasses-frame.html @@ -2,9 +2,9 @@ - -All Classes (picocli 4.0.0-alpha-2 API) - + +All Classes (picocli 4.0.0-alpha-3 API) + @@ -22,11 +22,13 @@
  • CommandLine.DuplicateNameException
  • CommandLine.DuplicateOptionAnnotationsException
  • CommandLine.ExecutionException
  • +
  • CommandLine.ExitCode
  • CommandLine.Help
  • CommandLine.Help.Ansi
  • CommandLine.Help.Ansi.IStyle
  • CommandLine.Help.Ansi.Style
  • CommandLine.Help.ColorScheme
  • +
  • CommandLine.Help.ColorScheme.Builder
  • CommandLine.Help.Column
  • CommandLine.Help.Column.Overflow
  • CommandLine.Help.IOptionRenderer
  • @@ -40,11 +42,17 @@
  • CommandLine.IDefaultValueProvider
  • CommandLine.IExceptionHandler
  • CommandLine.IExceptionHandler2
  • +
  • CommandLine.IExecutionExceptionHandler
  • +
  • CommandLine.IExecutionStrategy
  • +
  • CommandLine.IExitCodeExceptionMapper
  • +
  • CommandLine.IExitCodeGenerator
  • CommandLine.IFactory
  • CommandLine.IHelpCommandInitializable
  • +
  • CommandLine.IHelpCommandInitializable2
  • CommandLine.IHelpFactory
  • CommandLine.IHelpSectionRenderer
  • CommandLine.InitializationException
  • +
  • CommandLine.IParameterExceptionHandler
  • CommandLine.IParseResultHandler
  • CommandLine.IParseResultHandler2
  • CommandLine.ITypeConverter
  • diff --git a/docs/apidocs/allclasses-noframe.html b/docs/apidocs/allclasses-noframe.html index 1d06ff6d..bf4a575e 100644 --- a/docs/apidocs/allclasses-noframe.html +++ b/docs/apidocs/allclasses-noframe.html @@ -2,9 +2,9 @@ - -All Classes (picocli 4.0.0-alpha-2 API) - + +All Classes (picocli 4.0.0-alpha-3 API) + @@ -22,11 +22,13 @@
  • CommandLine.DuplicateNameException
  • CommandLine.DuplicateOptionAnnotationsException
  • CommandLine.ExecutionException
  • +
  • CommandLine.ExitCode
  • CommandLine.Help
  • CommandLine.Help.Ansi
  • CommandLine.Help.Ansi.IStyle
  • CommandLine.Help.Ansi.Style
  • CommandLine.Help.ColorScheme
  • +
  • CommandLine.Help.ColorScheme.Builder
  • CommandLine.Help.Column
  • CommandLine.Help.Column.Overflow
  • CommandLine.Help.IOptionRenderer
  • @@ -40,11 +42,17 @@
  • CommandLine.IDefaultValueProvider
  • CommandLine.IExceptionHandler
  • CommandLine.IExceptionHandler2
  • +
  • CommandLine.IExecutionExceptionHandler
  • +
  • CommandLine.IExecutionStrategy
  • +
  • CommandLine.IExitCodeExceptionMapper
  • +
  • CommandLine.IExitCodeGenerator
  • CommandLine.IFactory
  • CommandLine.IHelpCommandInitializable
  • +
  • CommandLine.IHelpCommandInitializable2
  • CommandLine.IHelpFactory
  • CommandLine.IHelpSectionRenderer
  • CommandLine.InitializationException
  • +
  • CommandLine.IParameterExceptionHandler
  • CommandLine.IParseResultHandler
  • CommandLine.IParseResultHandler2
  • CommandLine.ITypeConverter
  • diff --git a/docs/apidocs/constant-values.html b/docs/apidocs/constant-values.html index 3431a723..d669161f 100644 --- a/docs/apidocs/constant-values.html +++ b/docs/apidocs/constant-values.html @@ -2,9 +2,9 @@ - -Constant Field Values (picocli 4.0.0-alpha-2 API) - + +Constant Field Values (picocli 4.0.0-alpha-3 API) + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ diff --git a/docs/apidocs/overview-summary.html b/docs/apidocs/overview-summary.html index 0952a9f6..e678188a 100644 --- a/docs/apidocs/overview-summary.html +++ b/docs/apidocs/overview-summary.html @@ -2,9 +2,9 @@ - -Overview (picocli 4.0.0-alpha-2 API) - + +Overview (picocli 4.0.0-alpha-3 API) + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,14 +12,14 @@ @@ -12,14 +12,14 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,14 +12,14 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ + + + + + + + + + +
    +
    picocli
    +

    Class CommandLine.ExitCode

    +
    +
    + +
    +
      +
    • +
      +
      Enclosing class:
      +
      CommandLine
      +
      +
      +
      +
      public static final class CommandLine.ExitCode
      +extends Object
      +
      Defines some exit codes used by picocli as default return values from the execute + and executeHelpRequest methods. +

      Commands can override these defaults with annotations (e.g. @Command(exitCodeOnInvalidInput = 12345) + or programmatically (e.g. CommandLine.Model.CommandSpec.exitCodeOnInvalidInput(int)).

      +

      Additionally, there are several mechanisms for commands to return custom exit codes. + See the javadoc of the execute method for details.

      +
      +
      Since:
      +
      4.0
      +
      +
    • +
    +
    +
    +
      +
    • + +
        +
      • + + +

        Field Summary

        + + + + + + + + + + + + + + + + + + +
        Fields 
        Modifier and TypeField and Description
        static intOK +
        Return value from the execute and + executeHelpRequest methods signifying successful termination.
        +
        static intSOFTWARE +
        Return value from the execute method signifying internal software error: an exception occurred when invoking the Runnable, Callable or Method user object of a command.
        +
        static intUSAGE +
        Return value from the execute method signifying command line usage error: user input for the command was incorrect, e.g., the wrong number of arguments, a bad flag, a bad syntax in a parameter, or whatever.
        +
        +
      • +
      + + +
    • +
    +
    +
    +
      +
    • + +
        +
      • + + +

        Field Detail

        + + + + + + + +
          +
        • +

          USAGE

          +
          public static final int USAGE
          +
          Return value from the execute method signifying command line usage error: user input for the command was incorrect, e.g., the wrong number of arguments, a bad flag, a bad syntax in a parameter, or whatever.

          The value of this constant is 64, following unix C/C++ system programming conventions.

          +
          +
          See Also:
          +
          Constant Field Values
          +
          +
        • +
        + + + +
          +
        • +

          SOFTWARE

          +
          public static final int SOFTWARE
          +
          Return value from the execute method signifying internal software error: an exception occurred when invoking the Runnable, Callable or Method user object of a command.

          The value of this constant is 70, following unix C/C++ system programming conventions.

          +
          +
          See Also:
          +
          Constant Field Values
          +
          +
        • +
        +
      • +
      +
    • +
    +
    +
    + + + + + + + diff --git a/docs/apidocs/picocli/CommandLine.Help.Ansi.IStyle.html b/docs/apidocs/picocli/CommandLine.Help.Ansi.IStyle.html index eeb39128..b699aaaf 100644 --- a/docs/apidocs/picocli/CommandLine.Help.Ansi.IStyle.html +++ b/docs/apidocs/picocli/CommandLine.Help.Ansi.IStyle.html @@ -2,9 +2,9 @@ - -CommandLine.Help.Ansi.IStyle (picocli 4.0.0-alpha-2 API) - + +CommandLine.Help.Ansi.IStyle (picocli 4.0.0-alpha-3 API) + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ + + + + + + + + + +
    +
    picocli
    +

    Class CommandLine.Help.ColorScheme.Builder

    +
    +
    + +
    +
      +
    • +
      +
      Enclosing class:
      +
      CommandLine.Help.ColorScheme
      +
      +
      +
      +
      public static class CommandLine.Help.ColorScheme.Builder
      +extends Object
      +
      Builder class to create ColorScheme instances.
      +
      +
      Since:
      +
      4.0
      +
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          Builder

          +
          public Builder()
          +
          Constructs an empty color scheme builder with Ansi.AUTO.
          +
        • +
        + + + +
          +
        • +

          Builder

          +
          public Builder(CommandLine.Help.Ansi ansi)
          +
          Constructs an empty color scheme builder with the specified Ansi value.
          +
        • +
        + + + +
          +
        • +

          Builder

          +
          public Builder(CommandLine.Help.ColorScheme existing)
          +
          Constructs a color scheme builder with all attributes copied from the specified color scheme.
          +
        • +
        +
      • +
      + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          ansi

          +
          public CommandLine.Help.Ansi ansi()
          +
          Returns the Ansi setting of this color scheme builder.
          +
        • +
        + + + + + + + + + + + + + + + +
          +
        • +

          parameterStyles

          +
          public List<CommandLine.Help.Ansi.IStyle> parameterStyles()
          +
          Returns the registered styles for positional parameters in this color scheme builder.
          +
        • +
        + + + +
          +
        • +

          optionParamStyles

          +
          public List<CommandLine.Help.Ansi.IStyle> optionParamStyles()
          +
          Returns the registered styles for option parameters in this color scheme builder.
          +
        • +
        + + + +
          +
        • +

          commands

          +
          public CommandLine.Help.ColorScheme.Builder commands(CommandLine.Help.Ansi.IStyle... styles)
          +
          Adds the specified styles to the registered styles for commands in this color scheme builder and returns this builder.
          +
          +
          Parameters:
          +
          styles - the styles to add to the registered styles for commands in this color scheme builder
          +
          Returns:
          +
          this color scheme builder to enable method chaining for a more fluent API
          +
          +
        • +
        + + + +
          +
        • +

          options

          +
          public CommandLine.Help.ColorScheme.Builder options(CommandLine.Help.Ansi.IStyle... styles)
          +
          Adds the specified styles to the registered styles for options in this color scheme and returns this color scheme.
          +
          +
          Parameters:
          +
          styles - the styles to add to registered the styles for options in this color scheme builder
          +
          Returns:
          +
          this color scheme builder to enable method chaining for a more fluent API
          +
          +
        • +
        + + + +
          +
        • +

          parameters

          +
          public CommandLine.Help.ColorScheme.Builder parameters(CommandLine.Help.Ansi.IStyle... styles)
          +
          Adds the specified styles to the registered styles for positional parameters in this color scheme builder and returns this builder.
          +
          +
          Parameters:
          +
          styles - the styles to add to registered the styles for parameters in this color scheme builder
          +
          Returns:
          +
          this color scheme builder to enable method chaining for a more fluent API
          +
          +
        • +
        + + + +
          +
        • +

          optionParams

          +
          public CommandLine.Help.ColorScheme.Builder optionParams(CommandLine.Help.Ansi.IStyle... styles)
          +
          Adds the specified styles to the registered styles for option parameters in this color scheme builder and returns this builder.
          +
          +
          Parameters:
          +
          styles - the styles to add to the registered styles for option parameters in this color scheme builder
          +
          Returns:
          +
          this color scheme builder to enable method chaining for a more fluent API
          +
          +
        • +
        + + + +
          +
        • +

          applySystemProperties

          +
          public CommandLine.Help.ColorScheme.Builder applySystemProperties()
          +
          Replaces colors and styles in this scheme builder with ones specified in system properties, and returns this builder. + Supported property names:
            +
          • picocli.color.commands
          • +
          • picocli.color.options
          • +
          • picocli.color.parameters
          • +
          • picocli.color.optionParams
          • +

          Property values can be anything that CommandLine.Help.Ansi.Style.parse(String) can handle.

          +
          +
          Returns:
          +
          this ColorScheme builder
          +
          +
        • +
        + + + +
          +
        • +

          build

          +
          public CommandLine.Help.ColorScheme build()
          +
          Creates and returns a new ColorScheme with the values configured on this builder.
          +
        • +
        +
      • +
      +
    • +
    +
    +
    + + + + + + + diff --git a/docs/apidocs/picocli/CommandLine.Help.ColorScheme.html b/docs/apidocs/picocli/CommandLine.Help.ColorScheme.html index 91ba5d3f..308ef3a7 100644 --- a/docs/apidocs/picocli/CommandLine.Help.ColorScheme.html +++ b/docs/apidocs/picocli/CommandLine.Help.ColorScheme.html @@ -2,9 +2,9 @@ - -CommandLine.Help.ColorScheme (picocli 4.0.0-alpha-2 API) - + +CommandLine.Help.ColorScheme (picocli 4.0.0-alpha-3 API) + @@ -12,13 +12,13 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,13 +12,13 @@ @@ -12,14 +12,14 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,14 +12,14 @@ + + + + + + + + + +
    +
    picocli
    +

    Interface CommandLine.IExecutionExceptionHandler

    +
    +
    +
    +
      +
    • +
      +
      Enclosing class:
      +
      CommandLine
      +
      +
      +
      +
      public static interface CommandLine.IExecutionExceptionHandler
      +
      Classes implementing this interface know how to handle Exceptions that occurred while executing the Runnable, Callable or Method user object of the command. +

      Implementation Requirements:

      +

      Implementors that need to print messages to the console should use the output and error PrintWriters, + and the color scheme from the CommandLine object obtained from the exception.

      +

      API Note:

      +

      This interface supersedes CommandLine.IExceptionHandler2.

      +

      Example usage:

      +
      + IExecutionExceptionHandler errorHandler = new IExecutionExceptionHandler() {
      +     public int handleExecutionException(Exception ex,
      +                                         CommandLine commandLine,
      +                                         ParseResult parseResult) {
      +         //ex.printStackTrace(); // no stack trace
      +         commandLine.getErr().println(ex.getMessage());
      +         commandLine.usage(commandLine.getErr());
      +         return commandLine.getCommandSpec().exitCodeOnExecutionException();
      +     }
      + };
      + int exitCode = new CommandLine(new App())
      +         .setExecutionExceptionHandler(errorHandler)
      +         .execute(args);
      + 
      +
      +
      Since:
      +
      4.0
      +
      See Also:
      +
      CommandLine.setExecutionExceptionHandler(IExecutionExceptionHandler)
      +
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          handleExecutionException

          +
          int handleExecutionException(Exception ex,
          +                             CommandLine commandLine,
          +                             CommandLine.ParseResult parseResult)
          +                      throws Exception
          +
          Handles an Exception that occurred while executing the Runnable or + Callable command and returns an exit code suitable for returning from CommandLine.execute(String...).
          +
          +
          Parameters:
          +
          ex - the Exception thrown by the Runnable, Callable or Method user object of the command
          +
          commandLine - the CommandLine representing the command or subcommand where the exception occurred
          +
          parseResult - the result of parsing the command line arguments
          +
          Returns:
          +
          an exit code
          +
          Throws:
          +
          Exception
          +
          +
        • +
        +
      • +
      +
    • +
    +
    +
    + + + + + + + diff --git a/docs/apidocs/picocli/CommandLine.IExecutionStrategy.html b/docs/apidocs/picocli/CommandLine.IExecutionStrategy.html new file mode 100644 index 00000000..db2c94f5 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.IExecutionStrategy.html @@ -0,0 +1,261 @@ + + + + + +CommandLine.IExecutionStrategy (picocli 4.0.0-alpha-3 API) + + + + + + + + + + + + +
    +
    picocli
    +

    Interface CommandLine.IExecutionStrategy

    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + + + + + + + diff --git a/docs/apidocs/picocli/CommandLine.IExitCodeExceptionMapper.html b/docs/apidocs/picocli/CommandLine.IExitCodeExceptionMapper.html new file mode 100644 index 00000000..181b1d22 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.IExitCodeExceptionMapper.html @@ -0,0 +1,263 @@ + + + + + +CommandLine.IExitCodeExceptionMapper (picocli 4.0.0-alpha-3 API) + + + + + + + + + + + + +
    +
    picocli
    +

    Interface CommandLine.IExitCodeExceptionMapper

    +
    +
    +
    +
      +
    • +
      +
      Enclosing class:
      +
      CommandLine
      +
      +
      +
      +
      public static interface CommandLine.IExitCodeExceptionMapper
      +
      Interface that provides the appropriate exit code that will be returned from the execute + method for an exception that occurred during parsing or while invoking the command's Runnable, Callable, or Method. +

      Example usage:

      +
      + @Command
      + class FailingCommand implements Callable<Void> {
      +     public Void call() throws IOException {
      +         throw new IOException("error");
      +     }
      + }
      + IExitCodeExceptionMapper mapper = new IExitCodeExceptionMapper() {
      +     public int getExitCode(Throwable t) {
      +         if (t instanceof IOException && "error".equals(t.getMessage())) {
      +             return 123;
      +         }
      +         return 987;
      +     }
      + }
      +
      + CommandLine cmd = new CommandLine(new FailingCommand());
      + cmd.setExitCodeExceptionMapper(mapper);
      + int exitCode = cmd.execute(args);
      + assert exitCode == 123;
      + System.exit(exitCode);
      + 
      +
      +
      Since:
      +
      4.0
      +
      See Also:
      +
      CommandLine.setExitCodeExceptionMapper(IExitCodeExceptionMapper)
      +
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          getExitCode

          +
          int getExitCode(Throwable exception)
          +
          Returns the exit code that should be returned from the execute method.
          +
          +
          Parameters:
          +
          exception - the exception that occurred during parsing or while invoking the command's Runnable, Callable, or Method.
          +
          Returns:
          +
          the exit code
          +
          +
        • +
        +
      • +
      +
    • +
    +
    +
    + + + + + + + diff --git a/docs/apidocs/picocli/CommandLine.IExitCodeGenerator.html b/docs/apidocs/picocli/CommandLine.IExitCodeGenerator.html new file mode 100644 index 00000000..38cef46f --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.IExitCodeGenerator.html @@ -0,0 +1,249 @@ + + + + + +CommandLine.IExitCodeGenerator (picocli 4.0.0-alpha-3 API) + + + + + + + + + + + + +
    +
    picocli
    +

    Interface CommandLine.IExitCodeGenerator

    +
    +
    +
    +
      +
    • +
      +
      Enclosing class:
      +
      CommandLine
      +
      +
      +
      +
      public static interface CommandLine.IExitCodeGenerator
      +
      @Command-annotated classes can implement this interface to specify an exit code that will be returned + from the execute method when the command is successfully invoked. + +

      Example usage:

      +
      + @Command
      + class MyCommand implements Runnable, IExitCodeGenerator {
      +     public void run() { System.out.println("Hello"); }
      +     public int getExitCode() { return 123; }
      + }
      + CommandLine cmd = new CommandLine(new MyCommand());
      + int exitCode = cmd.execute(args);
      + assert exitCode == 123;
      + System.exit(exitCode);
      + 
      +
      +
      Since:
      +
      4.0
      +
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          getExitCode

          +
          int getExitCode()
          +
          Returns the exit code that should be returned from the execute method.
          +
          +
          Returns:
          +
          the exit code
          +
          +
        • +
        +
      • +
      +
    • +
    +
    +
    + + + + + + + diff --git a/docs/apidocs/picocli/CommandLine.IFactory.html b/docs/apidocs/picocli/CommandLine.IFactory.html index 080853c0..af8cae36 100644 --- a/docs/apidocs/picocli/CommandLine.IFactory.html +++ b/docs/apidocs/picocli/CommandLine.IFactory.html @@ -2,9 +2,9 @@ - -CommandLine.IFactory (picocli 4.0.0-alpha-2 API) - + +CommandLine.IFactory (picocli 4.0.0-alpha-3 API) + @@ -12,7 +12,7 @@ @@ -12,14 +12,14 @@ + + + + + + + + + +
    +
    picocli
    +

    Interface CommandLine.IHelpCommandInitializable2

    +
    +
    +
    +
      +
    • +
      +
      All Known Implementing Classes:
      +
      CommandLine.HelpCommand
      +
      +
      +
      Enclosing class:
      +
      CommandLine
      +
      +
      +
      +
      public static interface CommandLine.IHelpCommandInitializable2
      +
      Help commands that provide usage help for other commands can implement this interface to be initialized with the information they need. +

      The CommandLine::printHelpIfRequested method calls the + init method on commands marked as helpCommand + before the help command's run or call method is called.

      +

      Implementation note:

      + If an error occurs in the run or call method while processing the help request, it is recommended custom Help + commands throw a ParameterException with a reference to the parent command. + The default ParameterException handler will print the error message and the usage for the parent command. +

      +
      +
      Since:
      +
      4.0
      +
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          init

          +
          void init(CommandLine helpCommandLine,
          +          CommandLine.Help.ColorScheme colorScheme,
          +          PrintWriter outWriter,
          +          PrintWriter errWriter)
          +
          Initializes this object with the information needed to implement a help command that provides usage help for other commands.
          +
          +
          Parameters:
          +
          helpCommandLine - the CommandLine object associated with this help command. Implementors can use + this to walk the command hierarchy and get access to the help command's parent and sibling commands.
          +
          colorScheme - the color scheme to use when printing help, including whether to use Ansi colors or not
          +
          outWriter - the output writer to print the usage help message to
          +
          errWriter - the error writer to print any diagnostic messages to, in addition to the output from the exception handler
          +
          +
        • +
        +
      • +
      +
    • +
    +
    +
    + + + + + + + diff --git a/docs/apidocs/picocli/CommandLine.IHelpFactory.html b/docs/apidocs/picocli/CommandLine.IHelpFactory.html index 8f1cd129..983219d5 100644 --- a/docs/apidocs/picocli/CommandLine.IHelpFactory.html +++ b/docs/apidocs/picocli/CommandLine.IHelpFactory.html @@ -2,9 +2,9 @@ - -CommandLine.IHelpFactory (picocli 4.0.0-alpha-2 API) - + +CommandLine.IHelpFactory (picocli 4.0.0-alpha-3 API) + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ + + + + + + + + + +
    +
    picocli
    +

    Interface CommandLine.IParameterExceptionHandler

    +
    +
    +
    + +
    +
    + +
    +
    +
      +
    • + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          handleParseException

          +
          int handleParseException(CommandLine.ParameterException ex,
          +                         String[] args)
          +                  throws Exception
          +
          Handles a ParameterException that occurred while parsing the command + line arguments and returns an exit code suitable for returning from CommandLine.execute(String...).
          +
          +
          Parameters:
          +
          ex - the ParameterException describing the problem that occurred while parsing the command line arguments, + and the CommandLine representing the command or subcommand whose input was invalid
          +
          args - the command line arguments that could not be parsed
          +
          Returns:
          +
          an exit code
          +
          Throws:
          +
          Exception
          +
          +
        • +
        +
      • +
      +
    • +
    +
    +
    + + + + + + + diff --git a/docs/apidocs/picocli/CommandLine.IParseResultHandler.html b/docs/apidocs/picocli/CommandLine.IParseResultHandler.html index 485e68ef..fd516e46 100644 --- a/docs/apidocs/picocli/CommandLine.IParseResultHandler.html +++ b/docs/apidocs/picocli/CommandLine.IParseResultHandler.html @@ -2,9 +2,9 @@ - -CommandLine.IParseResultHandler (picocli 4.0.0-alpha-2 API) - + +CommandLine.IParseResultHandler (picocli 4.0.0-alpha-3 API) + @@ -12,7 +12,7 @@ @@ -12,14 +12,14 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,13 +12,13 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,14 +12,14 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,13 +12,13 @@ @@ -12,13 +12,13 @@ @@ -12,13 +12,13 @@ @@ -12,13 +12,13 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,13 +12,13 @@ @@ -12,13 +12,13 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ diff --git a/docs/apidocs/picocli/groovy/package-summary.html b/docs/apidocs/picocli/groovy/package-summary.html index f0d054db..7da95df0 100644 --- a/docs/apidocs/picocli/groovy/package-summary.html +++ b/docs/apidocs/picocli/groovy/package-summary.html @@ -2,9 +2,9 @@ - -picocli.groovy (picocli 4.0.0-alpha-2 API) - + +picocli.groovy (picocli 4.0.0-alpha-3 API) + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -20,10 +20,16 @@
  • CommandLine.IDefaultValueProvider
  • CommandLine.IExceptionHandler
  • CommandLine.IExceptionHandler2
  • +
  • CommandLine.IExecutionExceptionHandler
  • +
  • CommandLine.IExecutionStrategy
  • +
  • CommandLine.IExitCodeExceptionMapper
  • +
  • CommandLine.IExitCodeGenerator
  • CommandLine.IFactory
  • CommandLine.IHelpCommandInitializable
  • +
  • CommandLine.IHelpCommandInitializable2
  • CommandLine.IHelpFactory
  • CommandLine.IHelpSectionRenderer
  • +
  • CommandLine.IParameterExceptionHandler
  • CommandLine.IParseResultHandler
  • CommandLine.IParseResultHandler2
  • CommandLine.ITypeConverter
  • @@ -42,8 +48,10 @@
  • CommandLine.AbstractHandler
  • CommandLine.AbstractParseResultHandler
  • CommandLine.DefaultExceptionHandler
  • +
  • CommandLine.ExitCode
  • CommandLine.Help
  • CommandLine.Help.ColorScheme
  • +
  • CommandLine.Help.ColorScheme.Builder
  • CommandLine.Help.Column
  • CommandLine.Help.Layout
  • CommandLine.Help.TextTable
  • diff --git a/docs/apidocs/picocli/package-summary.html b/docs/apidocs/picocli/package-summary.html index c52f0c4f..fdc23e1c 100644 --- a/docs/apidocs/picocli/package-summary.html +++ b/docs/apidocs/picocli/package-summary.html @@ -2,9 +2,9 @@ - -picocli (picocli 4.0.0-alpha-2 API) - + +picocli (picocli 4.0.0-alpha-3 API) + @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@