From f6ea732808ae61d97aa74fb49181ebda3541d799 Mon Sep 17 00:00:00 2001 From: Remko Popma Date: Wed, 21 Mar 2018 01:48:43 +0900 Subject: [PATCH] Release picocli version 3.0.0-alpha-1 --- .../picocli/CommandLine.AbstractHandler.html | 492 ++++++++ ...ommandLine.AbstractParseResultHandler.html | 370 ++++++ ...Line.AbstractSimpleParseResultHandler.html | 370 ++++++ .../picocli/CommandLine.Help.Visibility.html | 356 ++++++ .../picocli/CommandLine.HelpCommand.html | 332 ++++++ .../CommandLine.IExceptionHandler2.html | 300 +++++ ...CommandLine.IHelpCommandInitializable.html | 256 ++++ .../CommandLine.IParseResultHandler2.html | 275 +++++ docs/apidocs/picocli/CommandLine.Mixin.html | 257 ++++ .../picocli/CommandLine.Model.ArgSpec.html | 568 +++++++++ .../CommandLine.Model.CommandSpec.html | 1014 ++++++++++++++++ .../picocli/CommandLine.Model.IBinding.html | 272 +++++ .../CommandLine.Model.OptionSpec.Builder.html | 564 +++++++++ .../picocli/CommandLine.Model.OptionSpec.html | 511 ++++++++ .../picocli/CommandLine.Model.ParserSpec.html | 432 +++++++ ...ine.Model.PositionalParamSpec.Builder.html | 528 +++++++++ ...CommandLine.Model.PositionalParamSpec.html | 432 +++++++ ...ommandLine.Model.UnmatchedArgsBinding.html | 308 +++++ .../CommandLine.Model.UsageMessageSpec.html | 865 ++++++++++++++ docs/apidocs/picocli/CommandLine.Model.html | 271 +++++ .../CommandLine.ParseResult.Builder.html | 375 ++++++ .../picocli/CommandLine.ParseResult.html | 869 ++++++++++++++ .../picocli/CommandLine.Unmatched.html | 171 +++ docs/picocli-3.0-programmatic-api.html | 1050 +++++++++++++++++ 24 files changed, 11238 insertions(+) create mode 100644 docs/apidocs/picocli/CommandLine.AbstractHandler.html create mode 100644 docs/apidocs/picocli/CommandLine.AbstractParseResultHandler.html create mode 100644 docs/apidocs/picocli/CommandLine.AbstractSimpleParseResultHandler.html create mode 100644 docs/apidocs/picocli/CommandLine.Help.Visibility.html create mode 100644 docs/apidocs/picocli/CommandLine.HelpCommand.html create mode 100644 docs/apidocs/picocli/CommandLine.IExceptionHandler2.html create mode 100644 docs/apidocs/picocli/CommandLine.IHelpCommandInitializable.html create mode 100644 docs/apidocs/picocli/CommandLine.IParseResultHandler2.html create mode 100644 docs/apidocs/picocli/CommandLine.Mixin.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.ArgSpec.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.CommandSpec.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.IBinding.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.OptionSpec.Builder.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.OptionSpec.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.ParserSpec.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.PositionalParamSpec.Builder.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.PositionalParamSpec.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.UnmatchedArgsBinding.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.UsageMessageSpec.html create mode 100644 docs/apidocs/picocli/CommandLine.Model.html create mode 100644 docs/apidocs/picocli/CommandLine.ParseResult.Builder.html create mode 100644 docs/apidocs/picocli/CommandLine.ParseResult.html create mode 100644 docs/apidocs/picocli/CommandLine.Unmatched.html create mode 100644 docs/picocli-3.0-programmatic-api.html diff --git a/docs/apidocs/picocli/CommandLine.AbstractHandler.html b/docs/apidocs/picocli/CommandLine.AbstractHandler.html new file mode 100644 index 000000000..bf76bdd20 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.AbstractHandler.html @@ -0,0 +1,492 @@ + + + + + +CommandLine.AbstractHandler (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.AbstractHandler<R,T extends CommandLine.AbstractHandler<R,T>>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    R - the return type of this handler
    +
    T - The type of the handler subclass; for fluent API method chaining
    +
    +
    +
    Direct Known Subclasses:
    +
    CommandLine.AbstractParseResultHandler, CommandLine.AbstractSimpleParseResultHandler, CommandLine.DefaultExceptionHandler
    +
    +
    +
    Enclosing class:
    +
    CommandLine
    +
    +
    +
    +
    public abstract static class CommandLine.AbstractHandler<R,T extends CommandLine.AbstractHandler<R,T>>
    +extends java.lang.Object
    +
    Abstract superclass for CommandLine.IParseResultHandler2 and CommandLine.IExceptionHandler2 implementations. +

    Note that AbstractHandler is a generic type. This, along with the abstract self method, + allows method chaining to work properly in subclasses, without the need for casts. An example subclass can look like this:

    +
    
    + class MyResultHandler extends AbstractHandler<MyReturnType, MyResultHandler> implements IParseResultHandler2<MyReturnType> {
    +
    +     public MyReturnType handleParseResult(ParseResult parseResult, MyReturnType prototypeReturnValue) { ... }
    +
    +     protected MyResultHandler self() { return this; }
    + }
    + 
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      AbstractHandler() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethod and Description
      TandExit(int exitCode) +
      Indicates that the handler should call System.exit(int) after processing completes and sets the exit code to use as the termination status.
      +
      CommandLine.Help.Ansiansi() +
      Returns the ANSI style to use.
      +
      java.io.PrintStreamerr() +
      Returns the stream to print diagnostic messages to.
      +
      java.lang.IntegerexitCode() +
      Returns the exit code to use as the termination status, or null (the default) if the handler should + not call System.exit(int) after processing completes.
      +
      booleanhasExitCode() +
      Returns true if an exit code was set with andExit(int), or false (the default) if + the handler should not call System.exit(int) after processing completes.
      +
      java.io.PrintStreamout() +
      Returns the stream to print command output to.
      +
      protected RreturnResultOrExit(R result) +
      Convenience method for subclasses that returns the specified result object if no exit code was set, + or otherwise, if an exit code was set, calls System.exit with the configured + exit code to terminate the currently running Java virtual machine.
      +
      protected abstract Tself() +
      Returns this to allow method chaining when calling the setters for a fluent API.
      +
      TuseAnsi(CommandLine.Help.Ansi ansi) +
      Sets the ANSI style to use.
      +
      TuseErr(java.io.PrintStream err) +
      Sets the stream to print diagnostic messages to.
      +
      TuseOut(java.io.PrintStream out) +
      Sets the stream to print command output to.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AbstractHandler

        +
        public AbstractHandler()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        out

        +
        public java.io.PrintStream out()
        +
        Returns the stream to print command output to. Defaults to System.out, unless useOut(PrintStream) + was called with a different stream. +

        IParseResultHandler2 implementations should use this stream. + By convention, when the user requests + help with a --help or similar option, the usage help message is printed to the standard output stream so that it can be easily searched and paged.

        +
      • +
      + + + +
        +
      • +

        err

        +
        public java.io.PrintStream err()
        +
        Returns the stream to print diagnostic messages to. Defaults to System.err, unless useErr(PrintStream) + was called with a different stream.

        IExceptionHandler2 implementations should use this stream to print error + messages (which may include a usage help message) when an unexpected error occurs.

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

        exitCode

        +
        public java.lang.Integer exitCode()
        +
        Returns the exit code to use as the termination status, or null (the default) if the handler should + not call System.exit(int) after processing completes.
        +
        +
        See Also:
        +
        andExit(int)
        +
        +
      • +
      + + + +
        +
      • +

        hasExitCode

        +
        public boolean hasExitCode()
        +
        Returns true if an exit code was set with andExit(int), or false (the default) if + the handler should not call System.exit(int) after processing completes.
        +
      • +
      + + + + + +
        +
      • +

        returnResultOrExit

        +
        protected R returnResultOrExit(R result)
        +
        Convenience method for subclasses that returns the specified result object if no exit code was set, + or otherwise, if an exit code was set, calls System.exit with the configured + exit code to terminate the currently running Java virtual machine.
        +
      • +
      + + + +
        +
      • +

        self

        +
        protected abstract T self()
        +
        Returns this to allow method chaining when calling the setters for a fluent API.
        +
      • +
      + + + +
        +
      • +

        useOut

        +
        public T useOut(java.io.PrintStream out)
        +
        Sets the stream to print command output to. For use by IParseResultHandler2 implementations.
        +
        +
        See Also:
        +
        out()
        +
        +
      • +
      + + + +
        +
      • +

        useErr

        +
        public T useErr(java.io.PrintStream err)
        +
        Sets the stream to print diagnostic messages to. For use by IExceptionHandler2 implementations.
        +
        +
        See Also:
        +
        err()
        +
        +
      • +
      + + + + + + + +
        +
      • +

        andExit

        +
        public T andExit(int exitCode)
        +
        Indicates that the handler should call System.exit(int) after processing completes and sets the exit code to use as the termination status.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.AbstractParseResultHandler.html b/docs/apidocs/picocli/CommandLine.AbstractParseResultHandler.html new file mode 100644 index 000000000..e49592786 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.AbstractParseResultHandler.html @@ -0,0 +1,370 @@ + + + + + +CommandLine.AbstractParseResultHandler (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.AbstractParseResultHandler<R>

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

      Constructor Detail

      + + + +
        +
      • +

        AbstractParseResultHandler

        +
        public AbstractParseResultHandler()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

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

        handle

        +
        protected abstract R handle(CommandLine.ParseResult parseResult,
        +                            R prototypeReturnValue)
        +                     throws CommandLine.ExecutionException
        +
        Processes the specified ParseResult and returns the result as a list of objects. + Implementations are responsible for catching any exceptions thrown in the handle method, and + rethrowing an ExecutionException that details the problem and captures the offending CommandLine object.
        +
        +
        Parameters:
        +
        parseResult - the ParseResult that resulted from successfully parsing the command line arguments
        +
        prototypeReturnValue - prototype return value, may be returned as is when the user requested help for example, + or may be used to collect results from multiple subcommands, or may be used by the + handler for internal processing and a completely different object is returned
        +
        Returns:
        +
        the result of processing parse results, may be the specified prototype or some other object
        +
        Throws:
        +
        CommandLine.ExecutionException - if a problem occurred while processing the parse results; client code can use + CommandLine.ExecutionException.getCommandLine() to get the command or subcommand where processing failed
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.AbstractSimpleParseResultHandler.html b/docs/apidocs/picocli/CommandLine.AbstractSimpleParseResultHandler.html new file mode 100644 index 000000000..d0949b631 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.AbstractSimpleParseResultHandler.html @@ -0,0 +1,370 @@ + + + + + +CommandLine.AbstractSimpleParseResultHandler (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.AbstractSimpleParseResultHandler

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Help.Visibility.html b/docs/apidocs/picocli/CommandLine.Help.Visibility.html new file mode 100644 index 000000000..6d9a9400c --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Help.Visibility.html @@ -0,0 +1,356 @@ + + + + + +CommandLine.Help.Visibility (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Enum CommandLine.Help.Visibility

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

      Enum Constant Summary

      + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      ALWAYS 
      NEVER 
      ON_DEMAND 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static CommandLine.Help.VisibilityvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static CommandLine.Help.Visibility[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static CommandLine.Help.Visibility[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (CommandLine.Help.Visibility c : CommandLine.Help.Visibility.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static CommandLine.Help.Visibility valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.HelpCommand.html b/docs/apidocs/picocli/CommandLine.HelpCommand.html new file mode 100644 index 000000000..465b6a1ca --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.HelpCommand.html @@ -0,0 +1,332 @@ + + + + + +CommandLine.HelpCommand (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.HelpCommand

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.lang.Runnable, CommandLine.IHelpCommandInitializable
    +
    +
    +
    Enclosing class:
    +
    CommandLine
    +
    +
    +
    +
    public static final class CommandLine.HelpCommand
    +extends java.lang.Object
    +implements CommandLine.IHelpCommandInitializable, java.lang.Runnable
    +
    Help command that can be installed as a subcommand on all application commands. When invoked with a subcommand + argument, it prints usage help for the specified subcommand. For example:
    +
    + // print help for subcommand
    + command help subcommand
    + 

    + When invoked without additional parameters, it prints usage help for the parent command. For example: +

    +
    + // print help for command
    + command help
    + 
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      HelpCommand() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidinit(CommandLine helpCommandLine, + CommandLine.Help.Ansi ansi, + java.io.PrintStream out, + java.io.PrintStream err) +
      Initializes this object with the information needed to implement a help command that provides usage help for other commands.
      +
      voidrun() +
      Invokes usage for the specified command, or for the parent command.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HelpCommand

        +
        public HelpCommand()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        run

        +
        public void run()
        +
        Invokes usage for the specified command, or for the parent command.
        +
        +
        Specified by:
        +
        run in interface java.lang.Runnable
        +
        +
      • +
      + + + +
        +
      • +

        init

        +
        public void init(CommandLine helpCommandLine,
        +                 CommandLine.Help.Ansi ansi,
        +                 java.io.PrintStream out,
        +                 java.io.PrintStream err)
        +
        Initializes this object with the information needed to implement a help command that provides usage help for other commands.
        +
        +
        Specified by:
        +
        init in interface CommandLine.IHelpCommandInitializable
        +
        Parameters:
        +
        helpCommandLine - provides access to this command's parent and sibling commands
        +
        ansi - whether to use Ansi colors or not
        +
        out - the stream to print the usage help message to
        +
        err - the error stream to print any diagnostic messages to, in addition to the output from the exception handler
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.IExceptionHandler2.html b/docs/apidocs/picocli/CommandLine.IExceptionHandler2.html new file mode 100644 index 000000000..95b812a9a --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.IExceptionHandler2.html @@ -0,0 +1,300 @@ + + + + + +CommandLine.IExceptionHandler2 (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Interface CommandLine.IExceptionHandler2<R>

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

      Method Detail

      + + + + + +
        +
      • +

        handleParseException

        +
        R handleParseException(CommandLine.ParameterException ex,
        +                       R prototypeReturnValue,
        +                       java.lang.String[] args)
        +
        Handles a ParameterException that occurred while parsing the command + line arguments and optionally returns a list of results.
        +
        +
        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
        +
        prototypeReturnValue - prototype return value, may be returned as is or may be used by the + handler for internal processing and a completely different object is returned
        +
        args - the command line arguments that could not be parsed
        +
        Returns:
        +
        an object resulting from handling the exception
        +
        +
      • +
      + + + + + +
        +
      • +

        handleExecutionException

        +
        R handleExecutionException(CommandLine.ExecutionException ex,
        +                           R prototypeReturnValue,
        +                           CommandLine.ParseResult parseResult)
        +
        Handles a ExecutionException that occurred while executing the Runnable or + Callable command and optionally returns a list of results.
        +
        +
        Parameters:
        +
        ex - the ExecutionException describing the problem that occurred while executing the Runnable or + Callable command, and the CommandLine representing the command or subcommand that was being executed
        +
        prototypeReturnValue - prototype return value, may be returned as is or may be used by the + handler for internal processing and a completely different object is returned
        +
        parseResult - the result of parsing the command line arguments
        +
        Returns:
        +
        an object resulting from handling the exception
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.IHelpCommandInitializable.html b/docs/apidocs/picocli/CommandLine.IHelpCommandInitializable.html new file mode 100644 index 000000000..2f143991d --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.IHelpCommandInitializable.html @@ -0,0 +1,256 @@ + + + + + +CommandLine.IHelpCommandInitializable (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Interface CommandLine.IHelpCommandInitializable

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    CommandLine.HelpCommand
    +
    +
    +
    Enclosing class:
    +
    CommandLine
    +
    +
    +
    +
    public static interface CommandLine.IHelpCommandInitializable
    +
    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 CommandLine.ParameterException with a reference to the parent command. The CommandLine.DefaultExceptionHandler will print + the error message and the usage for the parent command, and will terminate with the exit code of the exception handler if one was set. +

    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidinit(CommandLine helpCommandLine, + CommandLine.Help.Ansi ansi, + java.io.PrintStream out, + java.io.PrintStream err) +
      Initializes this object with the information needed to implement a help command that provides usage help for other commands.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        init

        +
        void init(CommandLine helpCommandLine,
        +          CommandLine.Help.Ansi ansi,
        +          java.io.PrintStream out,
        +          java.io.PrintStream err)
        +
        Initializes this object with the information needed to implement a help command that provides usage help for other commands.
        +
        +
        Parameters:
        +
        helpCommandLine - provides access to this command's parent and sibling commands
        +
        ansi - whether to use Ansi colors or not
        +
        out - the stream to print the usage help message to
        +
        err - the error stream to print any diagnostic messages to, in addition to the output from the exception handler
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.IParseResultHandler2.html b/docs/apidocs/picocli/CommandLine.IParseResultHandler2.html new file mode 100644 index 000000000..8c8dbf9fc --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.IParseResultHandler2.html @@ -0,0 +1,275 @@ + + + + + +CommandLine.IParseResultHandler2 (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Interface CommandLine.IParseResultHandler2<R>

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

      Method Detail

      + + + + + +
        +
      • +

        handleParseResult

        +
        R handleParseResult(CommandLine.ParseResult parseResult,
        +                    R prototypeReturnValue)
        +             throws CommandLine.ExecutionException
        +
        Processes the ParseResult object resulting from successfully + parsing the command line arguments and returns a return value.
        +
        +
        Parameters:
        +
        parseResult - the ParseResult that resulted from successfully parsing the command line arguments
        +
        prototypeReturnValue - prototype return value, may be returned as is when the user requested help for example, + or may be used to collect results from multiple subcommands, or may be used by the + handler for internal processing and a completely different object is returned
        +
        Returns:
        +
        an object resulting from handling the parse result
        +
        Throws:
        +
        CommandLine.ParameterException - if a help command was invoked for an unknown subcommand. Any ParameterExceptions + thrown from this method are treated as if this exception was thrown during parsing and passed to the CommandLine.IExceptionHandler2
        +
        CommandLine.ExecutionException - if a problem occurred while processing the parse results; use + CommandLine.ExecutionException.getCommandLine() to get the command or subcommand where processing failed
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Mixin.html b/docs/apidocs/picocli/CommandLine.Mixin.html new file mode 100644 index 000000000..754cb0e8f --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Mixin.html @@ -0,0 +1,257 @@ + + + + + +CommandLine.Mixin (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Annotation Type CommandLine.Mixin

+
+
+
+
    +
  • +
    +
    +
    @Retention(value=RUNTIME)
    + @Target(value=FIELD)
    +public static @interface CommandLine.Mixin
    +

    + Fields annotated with @Mixin are "expanded" into the current command: @Option and + @Parameters in the mixin class are added to the options and positional parameters of this command. + A CommandLine.DuplicateOptionAnnotationsException is thrown if any of the options in the mixin has the same name as + an option in this command. +

    + The Mixin annotation provides a way to reuse common options and parameters without subclassing. For example: +

    + class HelloWorld implements Runnable {
    +
    +     // adds the --help and --version options to this command
    +     @Mixin
    +     private HelpOptions = new HelpOptions();
    +
    +     @Option(names = {"-u", "--userName"}, required = true, description = "The user name")
    +     String userName;
    +
    +     public void run() { System.out.println("Hello, " + userName); }
    + }
    +
    + // Common reusable help options.
    + class HelpOptions {
    +
    +     @Option(names = { "-h", "--help"}, usageHelp = true, description = "Display this help and exit")
    +     private boolean help;
    +
    +     @Option(names = { "-V", "--version"}, versionHelp = true, description = "Display version info and exit")
    +     private boolean versionHelp;
    + }
    + 
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Optional Element Summary

      + + + + + + + + + + +
      Optional Elements 
      Modifier and TypeOptional Element and Description
      java.lang.Stringname +
      Optionally specify a name that the mixin object can be retrieved with from the CommandSpec.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Element Detail

      + + + +
        +
      • +

        name

        +
        public abstract java.lang.String name
        +
        Optionally specify a name that the mixin object can be retrieved with from the CommandSpec. + If not specified the name of the annotated field is used.
        +
        +
        Returns:
        +
        a String to register the mixin object with, or an empty String if the name of the annotated field should be used
        +
        +
        +
        Default:
        +
        ""
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.ArgSpec.html b/docs/apidocs/picocli/CommandLine.Model.ArgSpec.html new file mode 100644 index 000000000..662862aa0 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.ArgSpec.html @@ -0,0 +1,568 @@ + + + + + +CommandLine.Model.ArgSpec (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.Model.ArgSpec

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

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethod and Description
      CommandLine.Rangearity() +
      Returns how many arguments this option or positional parameter requires.
      +
      java.lang.Class<?>[]auxiliaryTypes() +
      Returns auxiliary type information used when the type() is a generic Collection, Map or an abstract class.
      +
      CommandLine.Model.IBindingbinding() +
      Returns the CommandLine.Model.IBinding that is responsible for getting and setting the value of this argument.
      +
      CommandLine.ITypeConverter<?>[]converters() +
      Returns one or more type converters to use to convert the command line + argument into a strongly typed value (or key-value pair for map fields).
      +
      java.lang.ObjectdefaultValue() +
      Returns the default value of this option or positional parameter.
      +
      java.lang.String[]description() +
      Returns the description of this option, used when generating the usage documentation.
      +
      booleanequals(java.lang.Object obj) 
      inthashCode() 
      booleanhidden() +
      Returns whether this option should be excluded from the usage message.
      +
      abstract booleanisOption() +
      Returns true if this argument is a named option, false otherwise.
      +
      abstract booleanisPositional() +
      Returns true if this argument is a positional parameter, false otherwise.
      +
      java.lang.StringparamLabel() +
      Returns the name of the option or positional parameter used in the usage help message.
      +
      java.util.List<java.lang.String>rawStringValues() +
      Returns the command line arguments matched by this option or positional parameter spec.
      +
      booleanrequired() +
      Returns whether this is a required option or positional parameter.
      +
      CommandLine.Help.VisibilityshowDefaultValue() +
      Returns whether this option or positional parameter's default value should be shown in the usage help.
      +
      java.lang.StringsplitRegex() +
      Returns a regular expression to split option parameter values or "" if the value should not be split.
      +
      java.lang.StringtoString() +
      Returns a string respresentation of this option or positional parameter.
      +
      java.lang.Class<?>type() +
      Returns the type to convert the option or positional parameter to before setting the value.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        required

        +
        public boolean required()
        +
        Returns whether this is a required option or positional parameter.
        +
        +
        See Also:
        +
        CommandLine.Option.required()
        +
        +
      • +
      + + + +
        +
      • +

        description

        +
        public java.lang.String[] description()
        +
        Returns the description of this option, used when generating the usage documentation.
        +
        +
        See Also:
        +
        CommandLine.Option.description()
        +
        +
      • +
      + + + + + + + +
        +
      • +

        paramLabel

        +
        public java.lang.String paramLabel()
        +
        Returns the name of the option or positional parameter used in the usage help message.
        +
        +
        See Also:
        +
        {@link Parameters#paramLabel()}
        +
        +
      • +
      + + + +
        +
      • +

        auxiliaryTypes

        +
        public java.lang.Class<?>[] auxiliaryTypes()
        +
        Returns auxiliary type information used when the type() is a generic Collection, Map or an abstract class.
        +
        +
        See Also:
        +
        CommandLine.Option.type()
        +
        +
      • +
      + + + +
        +
      • +

        converters

        +
        public CommandLine.ITypeConverter<?>[] converters()
        +
        Returns one or more type converters to use to convert the command line + argument into a strongly typed value (or key-value pair for map fields). This is useful when a particular + option or positional parameter should use a custom conversion that is different from the normal conversion for the arg spec's type.
        +
        +
        See Also:
        +
        CommandLine.Option.converter()
        +
        +
      • +
      + + + +
        +
      • +

        splitRegex

        +
        public java.lang.String splitRegex()
        +
        Returns a regular expression to split option parameter values or "" if the value should not be split.
        +
        +
        See Also:
        +
        CommandLine.Option.split()
        +
        +
      • +
      + + + +
        +
      • +

        hidden

        +
        public boolean hidden()
        +
        Returns whether this option should be excluded from the usage message.
        +
        +
        See Also:
        +
        CommandLine.Option.hidden()
        +
        +
      • +
      + + + +
        +
      • +

        type

        +
        public java.lang.Class<?> type()
        +
        Returns the type to convert the option or positional parameter to before setting the value.
        +
      • +
      + + + +
        +
      • +

        defaultValue

        +
        public java.lang.Object defaultValue()
        +
        Returns the default value of this option or positional parameter.
        +
      • +
      + + + +
        +
      • +

        showDefaultValue

        +
        public CommandLine.Help.Visibility showDefaultValue()
        +
        Returns whether this option or positional parameter's default value should be shown in the usage help.
        +
      • +
      + + + + + + + +
        +
      • +

        isOption

        +
        public abstract boolean isOption()
        +
        Returns true if this argument is a named option, false otherwise.
        +
      • +
      + + + +
        +
      • +

        isPositional

        +
        public abstract boolean isPositional()
        +
        Returns true if this argument is a positional parameter, false otherwise.
        +
      • +
      + + + +
        +
      • +

        rawStringValues

        +
        public java.util.List<java.lang.String> rawStringValues()
        +
        Returns the command line arguments matched by this option or positional parameter spec.
        +
        +
        Returns:
        +
        the matched arguments as found on the command line: empty Strings for options without value, the values have not been split, and for map properties values may look like "key=value"
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        Returns a string respresentation of this option or positional parameter.
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(java.lang.Object obj)
        +
        +
        Overrides:
        +
        equals in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.CommandSpec.html b/docs/apidocs/picocli/CommandLine.Model.CommandSpec.html new file mode 100644 index 000000000..ebcc0a8d0 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.CommandSpec.html @@ -0,0 +1,1014 @@ + + + + + +CommandLine.Model.CommandSpec (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.Model.CommandSpec

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine.Model
    +
    +
    +
    +
    public static class CommandLine.Model.CommandSpec
    +extends java.lang.Object
    +
    The CommandSpec class models a command specification, including the options, positional parameters and subcommands + supported by the command, as well as attributes for the version help message and the usage help message of the command. +

    + Picocli views a command line application as a hierarchy of commands: there is a top-level command (usually the Java + class with the main method) with optionally a set of command line options, positional parameters and subcommands. + Subcommands themselves can have options, positional parameters and nested sub-subcommands to any level of depth. +

    + The object model has a corresponding hierarchy of CommandSpec objects, each with a set of CommandLine.Model.OptionSpec, + CommandLine.Model.PositionalParamSpec and subcommands associated with it. + This object model is used by the picocli command line interpreter and help message generator. +

    Picocli can construct a CommandSpec automatically from classes with @Command, @Option and + @Parameters annotations. Alternatively a CommandSpec can be constructed programmatically. +

    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        create

        +
        public static CommandLine.Model.CommandSpec create()
        +
        Creates and returns a new CommandSpec without any associated user object.
        +
      • +
      + + + +
        +
      • +

        wrapWithoutInspection

        +
        public static CommandLine.Model.CommandSpec wrapWithoutInspection(java.lang.Object userObject)
        +
        Creates and returns a new CommandSpec with the specified associated user object. + The specified user object is not inspected for annotations.
        +
        +
        Parameters:
        +
        userObject - the associated user object. May be any object, may be null.
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        userObject

        +
        public java.lang.Object userObject()
        +
        Returns the user object associated with this command.
        +
        +
        See Also:
        +
        CommandLine.getCommand()
        +
        +
      • +
      + + + +
        +
      • +

        commandLine

        +
        public CommandLine commandLine()
        +
        Returns the CommandLine constructed with this CommandSpec model.
        +
      • +
      + + + + + + + + + + + + + + + +
        +
      • +

        subcommands

        +
        public java.util.Map<java.lang.String,CommandLine> subcommands()
        +
        Returns a read-only view of the subcommand map.
        +
      • +
      + + + +
        +
      • +

        addSubcommand

        +
        public CommandLine.Model.CommandSpec addSubcommand(java.lang.String name,
        +                                                   CommandLine.Model.CommandSpec subcommand)
        +
        Adds the specified subcommand with the specified name.
        +
        +
        Parameters:
        +
        name - subcommand name - when this String is encountered in the command line arguments the subcommand is invoked
        +
        subcommand - describes the subcommand to envoke when the name is encountered on the command line
        +
        Returns:
        +
        this CommandSpec object for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        addSubcommand

        +
        public CommandLine.Model.CommandSpec addSubcommand(java.lang.String name,
        +                                                   CommandLine commandLine)
        +
        Adds the specified subcommand with the specified name.
        +
        +
        Parameters:
        +
        name - subcommand name - when this String is encountered in the command line arguments the subcommand is invoked
        +
        commandLine - the subcommand to envoke when the name is encountered on the command line
        +
        Returns:
        +
        this CommandSpec object for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        parent

        +
        public CommandLine.Model.CommandSpec parent()
        +
        Returns the parent command of this subcommand, or null if this is a top-level command.
        +
      • +
      + + + + + + + +
        +
      • +

        add

        +
        public CommandLine.Model.CommandSpec add(CommandLine.Model.ArgSpec arg)
        +
        Adds the specified option spec or positional parameter spec to the list of configured arguments to expect.
        +
        +
        Parameters:
        +
        arg - the option spec or positional parameter spec to add
        +
        Returns:
        +
        this CommandSpec for method chaining
        +
        +
      • +
      + + + + + + + +
        +
      • +

        addPositional

        +
        public CommandLine.Model.CommandSpec addPositional(CommandLine.Model.PositionalParamSpec positional)
        +
        Adds the specified positional parameter spec to the list of configured arguments to expect.
        +
        +
        Parameters:
        +
        positional - the positional parameter spec to add
        +
        Returns:
        +
        this CommandSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        addMixin

        +
        public CommandLine.Model.CommandSpec addMixin(java.lang.String name,
        +                                              CommandLine.Model.CommandSpec mixin)
        +
        Adds the specified mixin CommandSpec object to the map of mixins for this command.
        +
        +
        Parameters:
        +
        name - the name that can be used to later retrieve the mixin
        +
        mixin - the mixin whose options and positional parameters and other attributes to add to this command
        +
        Returns:
        +
        this CommandSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        addUnmatchedArgsBinding

        +
        public CommandLine.Model.CommandSpec addUnmatchedArgsBinding(CommandLine.Model.UnmatchedArgsBinding spec)
        +
        Adds the specified UnmatchedArgsBinding to the list of model objects to capture unmatched arguments for this command.
        +
        +
        Parameters:
        +
        spec - the unmatched arguments binding to capture unmatched arguments
        +
        Returns:
        +
        this CommandSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        mixins

        +
        public java.util.Map<java.lang.String,CommandLine.Model.CommandSpec> mixins()
        +
        Returns a map of the mixin names to mixin CommandSpec objects configured for this command.
        +
        +
        Returns:
        +
        an immutable map of mixins added to this command.
        +
        +
      • +
      + + + +
        +
      • +

        options

        +
        public java.util.List<CommandLine.Model.OptionSpec> options()
        +
        Returns the list of options configured for this command.
        +
        +
        Returns:
        +
        an immutable list of options that this command recognizes.
        +
        +
      • +
      + + + +
        +
      • +

        positionalParameters

        +
        public java.util.List<CommandLine.Model.PositionalParamSpec> positionalParameters()
        +
        Returns the list of positional parameters configured for this command.
        +
        +
        Returns:
        +
        an immutable list of positional parameters that this command recognizes.
        +
        +
      • +
      + + + +
        +
      • +

        optionsMap

        +
        public java.util.Map<java.lang.String,CommandLine.Model.OptionSpec> optionsMap()
        +
        Returns a map of the option names to option spec objects configured for this command.
        +
        +
        Returns:
        +
        an immutable map of options that this command recognizes.
        +
        +
      • +
      + + + +
        +
      • +

        posixOptionsMap

        +
        public java.util.Map<java.lang.Character,CommandLine.Model.OptionSpec> posixOptionsMap()
        +
        Returns a map of the short (single character) option names to option spec objects configured for this command.
        +
        +
        Returns:
        +
        an immutable map of options that this command recognizes.
        +
        +
      • +
      + + + +
        +
      • +

        requiredArgs

        +
        public java.util.List<CommandLine.Model.ArgSpec> requiredArgs()
        +
        Returns the list of required options and positional parameters configured for this command.
        +
        +
        Returns:
        +
        an immutable list of the required options and positional parameters for this command.
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        version

        +
        public java.lang.String[] version()
        +
        Returns version information for this command, to print to the console when the user specifies an + option to request version help. This is not part of the usage help message.
        +
        +
        Returns:
        +
        the version strings generated by the version provider if one is set, otherwise the version literals
        +
        +
      • +
      + + + +
        +
      • +

        versionProvider

        +
        public CommandLine.IVersionProvider versionProvider()
        +
        Returns the version provider for this command, to generate the version() strings.
        +
        +
        Returns:
        +
        the version provider or null if the version strings should be returned from the version literals.
        +
        +
      • +
      + + + +
        +
      • +

        helpCommand

        +
        public boolean helpCommand()
        +
        Returns whether this subcommand is a help command, and required options and positional + parameters of the parent command should not be validated.
        +
        +
        Returns:
        +
        true if this subcommand is a help command and picocli should not check for missing required + options and positional parameters on the parent command
        +
        See Also:
        +
        CommandLine.Command.helpCommand()
        +
        +
      • +
      + + + +
        +
      • +

        mixinStandardHelpOptions

        +
        public boolean mixinStandardHelpOptions()
        +
        Returns true if the standard help options have been mixed in with this command, false otherwise.
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        Returns a string representation of this command, used in error messages and trace messages.
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        name

        +
        public CommandLine.Model.CommandSpec name(java.lang.String name)
        +
        Sets the String to use as the program name in the synopsis line of the help message.
        +
        +
        Returns:
        +
        this CommandSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        version

        +
        public CommandLine.Model.CommandSpec version(java.lang.String... version)
        +
        Sets version information literals for this command, to print to the console when the user specifies an + option to request version help. Only used if no versionProvider is set.
        +
        +
        Returns:
        +
        this CommandSpec for method chaining
        +
        +
      • +
      + + + + + + + + + + + + + + + +
        +
      • +

        withToString

        +
        public CommandLine.Model.CommandSpec withToString(java.lang.String newValue)
        +
        Sets the string representation of this command, used in error messages and trace messages.
        +
        +
        Parameters:
        +
        newValue - the string representation
        +
        Returns:
        +
        this CommandSpec for method chaining
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.IBinding.html b/docs/apidocs/picocli/CommandLine.Model.IBinding.html new file mode 100644 index 000000000..0a9152cff --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.IBinding.html @@ -0,0 +1,272 @@ + + + + + +CommandLine.Model.IBinding (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Interface CommandLine.Model.IBinding

+
+
+
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine.Model
    +
    +
    +
    +
    public static interface CommandLine.Model.IBinding
    +
    Customizable binding for obtaining and modifying the current value of an option or positional parameter. + When an option or positional parameter is matched on the command line, its binding is invoked to capture the value. + For example, an option can be bound to a field or a method, and when the option is matched on the command line, the + field's value is set or the method is invoked with the option parameter value.
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      <T> Tget() +
      Returns the current value of the binding.
      +
      <T> Tset(T value) +
      Sets the new value of the binding.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        get

        +
        <T> T get()
        +   throws CommandLine.PicocliException
        +
        Returns the current value of the binding. For multi-value options and positional parameters, this method returns an + array, collection or map to add values to.
        +
        +
        Throws:
        +
        CommandLine.PicocliException - if a problem occurred while obtaining the current value
        +
        +
      • +
      + + + + + +
        +
      • +

        set

        +
        <T> T set(T value)
        +   throws CommandLine.PicocliException
        +
        Sets the new value of the binding. For multi-value options and positional parameters, this method is used to + set a new array instance that is one element larger than the previous instance, or to initialize the collection + or map when the getter returned null. For single-value options and positional parameters, + this method simply sets the value.
        +
        +
        Type Parameters:
        +
        T - type of the value
        +
        Parameters:
        +
        value - the new value of the binding
        +
        Returns:
        +
        the previous value of the binding (if supported by this binding)
        +
        Throws:
        +
        CommandLine.PicocliException - if a problem occurred while setting the new value
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.OptionSpec.Builder.html b/docs/apidocs/picocli/CommandLine.Model.OptionSpec.Builder.html new file mode 100644 index 000000000..a81fb9587 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.OptionSpec.Builder.html @@ -0,0 +1,564 @@ + + + + + +CommandLine.Model.OptionSpec.Builder (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.Model.OptionSpec.Builder

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine.Model.OptionSpec
    +
    +
    +
    +
    public static class CommandLine.Model.OptionSpec.Builder
    +extends java.lang.Object
    +
    Builder responsible for creating valid OptionSpec objects.
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      Tarity(CommandLine.Range arity) +
      Sets how many arguments this option or positional parameter requires, and returns this builder.
      +
      Tarity(java.lang.String range) +
      Sets how many arguments this option or positional parameter requires, and returns this builder.
      +
      TauxiliaryTypes(java.lang.Class<?>... types) +
      Sets auxiliary type information, and returns this builder.
      +
      Tbinding(CommandLine.Model.IBinding binding) +
      Sets the CommandLine.Model.IBinding that is responsible for getting and setting the value of this argument to the specified value, and returns this builder.
      +
      CommandLine.Model.OptionSpecbuild() +
      Returns a valid OptionSpec instance.
      +
      Tconverters(CommandLine.ITypeConverter<?>... cs) +
      Sets option/positional param-specific converter (or converters for Maps), and returns this builder.
      +
      TdefaultValue(java.lang.Object defaultValue) +
      Sets the default value of this option or positional parameter to the specified value, and returns this builder.
      +
      Tdescription(java.lang.String... description) +
      Sets the description of this option, used when generating the usage documentation, and returns this builder.
      +
      CommandLine.Model.OptionSpec.Builderhelp(boolean help) +
      Sets whether this option disables validation of the other arguments, and returns this builder.
      +
      Thidden(boolean hidden) +
      Sets whether this option should be excluded from the usage message, and returns this builder.
      +
      CommandLine.Model.OptionSpec.Buildernames(java.lang.String... names) +
      Replaces the option names with the specified values.
      +
      TparamLabel(java.lang.String paramLabel) +
      Sets the name of the option or positional parameter used in the usage help message, and returns this builder.
      +
      Trequired(boolean required) +
      Sets whether this is a required option or positional parameter, and returns this builder.
      +
      protected CommandLine.Model.OptionSpec.Builderself() +
      Returns this builder.
      +
      TshowDefaultValue(CommandLine.Help.Visibility visibility) +
      Sets whether this option or positional parameter's default value should be shown in the usage help, and returns this builder.
      +
      TsplitRegex(java.lang.String splitRegex) +
      Sets a regular expression to split option parameter values or "" if the value should not be split, and returns this builder.
      +
      Ttype(java.lang.Class<?> propertyType) +
      Sets the type to convert the option or positional parameter to before setting the value, and returns this builder.
      +
      CommandLine.Model.OptionSpec.BuilderusageHelp(boolean usageHelp) +
      Sets whether this option allows the user to request usage help, and returns this builder.
      +
      CommandLine.Model.OptionSpec.BuilderversionHelp(boolean versionHelp) +
      Sets whether this option allows the user to request version information, and returns this builder.
      +
      TwithToString(java.lang.String toString) +
      Sets the string respresentation of this option or positional parameter to the specified value, and returns this builder.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

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

        names

        +
        public CommandLine.Model.OptionSpec.Builder names(java.lang.String... names)
        +
        Replaces the option names with the specified values. At least one option name is required, and returns this builder.
        +
        +
        Returns:
        +
        this builder instance to provide a fluent interface
        +
        +
      • +
      + + + + + + + +
        +
      • +

        usageHelp

        +
        public CommandLine.Model.OptionSpec.Builder usageHelp(boolean usageHelp)
        +
        Sets whether this option allows the user to request usage help, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        versionHelp

        +
        public CommandLine.Model.OptionSpec.Builder versionHelp(boolean versionHelp)
        +
        Sets whether this option allows the user to request version information, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        required

        +
        public T required(boolean required)
        +
        Sets whether this is a required option or positional parameter, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        description

        +
        public T description(java.lang.String... description)
        +
        Sets the description of this option, used when generating the usage documentation, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        arity

        +
        public T arity(java.lang.String range)
        +
        Sets how many arguments this option or positional parameter requires, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        arity

        +
        public T arity(CommandLine.Range arity)
        +
        Sets how many arguments this option or positional parameter requires, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        paramLabel

        +
        public T paramLabel(java.lang.String paramLabel)
        +
        Sets the name of the option or positional parameter used in the usage help message, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        auxiliaryTypes

        +
        public T auxiliaryTypes(java.lang.Class<?>... types)
        +
        Sets auxiliary type information, and returns this builder.
        +
        +
        Parameters:
        +
        types - the element type(s) when the CommandLine.Model.ArgSpec.type() is a generic Collection or a Map; + or the concrete type when the CommandLine.Model.ArgSpec.type() is an abstract class.
        +
        +
      • +
      + + + +
        +
      • +

        converters

        +
        public T converters(CommandLine.ITypeConverter<?>... cs)
        +
        Sets option/positional param-specific converter (or converters for Maps), and returns this builder.
        +
      • +
      + + + +
        +
      • +

        splitRegex

        +
        public T splitRegex(java.lang.String splitRegex)
        +
        Sets a regular expression to split option parameter values or "" if the value should not be split, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        showDefaultValue

        +
        public T showDefaultValue(CommandLine.Help.Visibility visibility)
        +
        Sets whether this option or positional parameter's default value should be shown in the usage help, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        hidden

        +
        public T hidden(boolean hidden)
        +
        Sets whether this option should be excluded from the usage message, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        type

        +
        public T type(java.lang.Class<?> propertyType)
        +
        Sets the type to convert the option or positional parameter to before setting the value, and returns this builder.
        +
        +
        Parameters:
        +
        propertyType - the type of this option or parameter. For multi-value options and positional parameters this can be an array, or a (sub-type of) Collection or Map.
        +
        +
      • +
      + + + +
        +
      • +

        defaultValue

        +
        public T defaultValue(java.lang.Object defaultValue)
        +
        Sets the default value of this option or positional parameter to the specified value, and returns this builder.
        +
      • +
      + + + + + + + +
        +
      • +

        withToString

        +
        public T withToString(java.lang.String toString)
        +
        Sets the string respresentation of this option or positional parameter to the specified value, and returns this builder.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.OptionSpec.html b/docs/apidocs/picocli/CommandLine.Model.OptionSpec.html new file mode 100644 index 000000000..0cedffa52 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.OptionSpec.html @@ -0,0 +1,511 @@ + + + + + +CommandLine.Model.OptionSpec (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.Model.OptionSpec

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine.Model
    +
    +
    +
    +
    public static class CommandLine.Model.OptionSpec
    +extends CommandLine.Model.ArgSpec
    +
    The OptionSpec class models aspects of a named option of a command, including whether + it is required or optional, the option parameters supported (or required) by the option, + and attributes for the usage help message describing the option. +

    + An option has one or more names. The option is matched when the parser encounters one of the option names in the command line arguments. + Depending on the option's arity, + the parser may expect it to have option parameters. The parser will call setValue on + the matched option for each of the option parameters encountered. +

    + For multi-value options, the type may be an array, a Collection or a Map. In this case + the parser will get the data structure by calling getValue and modify the contents of this data structure. + (In the case of arrays, the array is replaced with a new instance with additional elements.) +

    + Before calling the setter, picocli converts the option parameter value from a String to the option parameter's type. +

    +
      +
    • If a option-specific converter is configured, this will be used for type conversion. + If the option's type is a Map, the map may have different types for its keys and its values, so + converters should provide two converters: one for the map keys and one for the map values.
    • +
    • Otherwise, the option's type is used to look up a converter in the list of + registered converters. + For multi-value options, + the type may be an array, or a Collection or a Map. In that case the elements are converted + based on the option's auxiliaryTypes. The auxiliaryType is used to look up + the converter(s) to use to convert the individual parameter values. + Maps may have different types for its keys and its values, so auxiliaryTypes + should provide two types: one for the map keys and one for the map values.
    • +
    +

    + OptionSpec objects are used by the picocli command line interpreter and help message generator. + Picocli can construct an OptionSpec automatically from fields and methods with @Option + annotations. Alternatively an OptionSpec can be constructed programmatically. +

    + When an OptionSpec is created from an @Option -annotated field or method, it is "bound" + to that field or method: this field is set (or the method is invoked) when the option is matched and + setValue is called. + Programmatically constructed OptionSpec instances will remember the value passed to the + setValue method so it can be retrieved with the getValue method. + This behaviour can be customized by installing a custom CommandLine.Model.IBinding on the OptionSpec. +

    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.ParserSpec.html b/docs/apidocs/picocli/CommandLine.Model.ParserSpec.html new file mode 100644 index 000000000..8eaa2fb2b --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.ParserSpec.html @@ -0,0 +1,432 @@ + + + + + +CommandLine.Model.ParserSpec (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.Model.ParserSpec

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine.Model
    +
    +
    +
    +
    public static class CommandLine.Model.ParserSpec
    +extends java.lang.Object
    +
    Models parser configuration specification.
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ParserSpec

        +
        public ParserSpec()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        separator

        +
        public java.lang.String separator()
        +
        Returns the String to use as the separator between options and option parameters. "=" by default, + initialized from CommandLine.Command.separator() if defined.
        +
      • +
      + + + +
        +
      • +

        stopAtUnmatched

        +
        public boolean stopAtUnmatched()
        +
      • +
      + + + +
        +
      • +

        stopAtPositional

        +
        public boolean stopAtPositional()
        +
      • +
      + + + +
        +
      • +

        overwrittenOptionsAllowed

        +
        public boolean overwrittenOptionsAllowed()
        +
      • +
      + + + +
        +
      • +

        unmatchedArgumentsAllowed

        +
        public boolean unmatchedArgumentsAllowed()
        +
      • +
      + + + +
        +
      • +

        expandAtFiles

        +
        public boolean expandAtFiles()
        +
      • +
      + + + +
        +
      • +

        separator

        +
        public CommandLine.Model.ParserSpec separator(java.lang.String separator)
        +
        Sets the String to use as the separator between options and option parameters.
        +
        +
        Returns:
        +
        this ParserSpec for method chaining
        +
        +
      • +
      + + + + + + + + + + + + + + + + + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.PositionalParamSpec.Builder.html b/docs/apidocs/picocli/CommandLine.Model.PositionalParamSpec.Builder.html new file mode 100644 index 000000000..f29e0af12 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.PositionalParamSpec.Builder.html @@ -0,0 +1,528 @@ + + + + + +CommandLine.Model.PositionalParamSpec.Builder (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.Model.PositionalParamSpec.Builder

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine.Model.PositionalParamSpec
    +
    +
    +
    +
    public static class CommandLine.Model.PositionalParamSpec.Builder
    +extends java.lang.Object
    +
    Builder responsible for creating valid PositionalParamSpec objects.
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      Tarity(CommandLine.Range arity) +
      Sets how many arguments this option or positional parameter requires, and returns this builder.
      +
      Tarity(java.lang.String range) +
      Sets how many arguments this option or positional parameter requires, and returns this builder.
      +
      TauxiliaryTypes(java.lang.Class<?>... types) +
      Sets auxiliary type information, and returns this builder.
      +
      Tbinding(CommandLine.Model.IBinding binding) +
      Sets the CommandLine.Model.IBinding that is responsible for getting and setting the value of this argument to the specified value, and returns this builder.
      +
      CommandLine.Model.PositionalParamSpecbuild() +
      Returns a valid PositionalParamSpec instance.
      +
      Tconverters(CommandLine.ITypeConverter<?>... cs) +
      Sets option/positional param-specific converter (or converters for Maps), and returns this builder.
      +
      TdefaultValue(java.lang.Object defaultValue) +
      Sets the default value of this option or positional parameter to the specified value, and returns this builder.
      +
      Tdescription(java.lang.String... description) +
      Sets the description of this option, used when generating the usage documentation, and returns this builder.
      +
      Thidden(boolean hidden) +
      Sets whether this option should be excluded from the usage message, and returns this builder.
      +
      CommandLine.Model.PositionalParamSpec.Builderindex(CommandLine.Range index) +
      Sets the index or range specifying which of the command line arguments should be assigned to this positional parameter, and returns this builder.
      +
      CommandLine.Model.PositionalParamSpec.Builderindex(java.lang.String range) +
      Sets the index or range specifying which of the command line arguments should be assigned to this positional parameter, and returns this builder.
      +
      TparamLabel(java.lang.String paramLabel) +
      Sets the name of the option or positional parameter used in the usage help message, and returns this builder.
      +
      Trequired(boolean required) +
      Sets whether this is a required option or positional parameter, and returns this builder.
      +
      protected CommandLine.Model.PositionalParamSpec.Builderself() +
      Returns this builder.
      +
      TshowDefaultValue(CommandLine.Help.Visibility visibility) +
      Sets whether this option or positional parameter's default value should be shown in the usage help, and returns this builder.
      +
      TsplitRegex(java.lang.String splitRegex) +
      Sets a regular expression to split option parameter values or "" if the value should not be split, and returns this builder.
      +
      Ttype(java.lang.Class<?> propertyType) +
      Sets the type to convert the option or positional parameter to before setting the value, and returns this builder.
      +
      TwithToString(java.lang.String toString) +
      Sets the string respresentation of this option or positional parameter to the specified value, and returns this builder.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

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

        index

        +
        public CommandLine.Model.PositionalParamSpec.Builder index(java.lang.String range)
        +
        Sets the index or range specifying which of the command line arguments should be assigned to this positional parameter, and returns this builder.
        +
      • +
      + + + + + + + +
        +
      • +

        required

        +
        public T required(boolean required)
        +
        Sets whether this is a required option or positional parameter, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        description

        +
        public T description(java.lang.String... description)
        +
        Sets the description of this option, used when generating the usage documentation, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        arity

        +
        public T arity(java.lang.String range)
        +
        Sets how many arguments this option or positional parameter requires, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        arity

        +
        public T arity(CommandLine.Range arity)
        +
        Sets how many arguments this option or positional parameter requires, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        paramLabel

        +
        public T paramLabel(java.lang.String paramLabel)
        +
        Sets the name of the option or positional parameter used in the usage help message, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        auxiliaryTypes

        +
        public T auxiliaryTypes(java.lang.Class<?>... types)
        +
        Sets auxiliary type information, and returns this builder.
        +
        +
        Parameters:
        +
        types - the element type(s) when the CommandLine.Model.ArgSpec.type() is a generic Collection or a Map; + or the concrete type when the CommandLine.Model.ArgSpec.type() is an abstract class.
        +
        +
      • +
      + + + +
        +
      • +

        converters

        +
        public T converters(CommandLine.ITypeConverter<?>... cs)
        +
        Sets option/positional param-specific converter (or converters for Maps), and returns this builder.
        +
      • +
      + + + +
        +
      • +

        splitRegex

        +
        public T splitRegex(java.lang.String splitRegex)
        +
        Sets a regular expression to split option parameter values or "" if the value should not be split, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        showDefaultValue

        +
        public T showDefaultValue(CommandLine.Help.Visibility visibility)
        +
        Sets whether this option or positional parameter's default value should be shown in the usage help, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        hidden

        +
        public T hidden(boolean hidden)
        +
        Sets whether this option should be excluded from the usage message, and returns this builder.
        +
      • +
      + + + +
        +
      • +

        type

        +
        public T type(java.lang.Class<?> propertyType)
        +
        Sets the type to convert the option or positional parameter to before setting the value, and returns this builder.
        +
        +
        Parameters:
        +
        propertyType - the type of this option or parameter. For multi-value options and positional parameters this can be an array, or a (sub-type of) Collection or Map.
        +
        +
      • +
      + + + +
        +
      • +

        defaultValue

        +
        public T defaultValue(java.lang.Object defaultValue)
        +
        Sets the default value of this option or positional parameter to the specified value, and returns this builder.
        +
      • +
      + + + + + + + +
        +
      • +

        withToString

        +
        public T withToString(java.lang.String toString)
        +
        Sets the string respresentation of this option or positional parameter to the specified value, and returns this builder.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.PositionalParamSpec.html b/docs/apidocs/picocli/CommandLine.Model.PositionalParamSpec.html new file mode 100644 index 000000000..adf02e871 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.PositionalParamSpec.html @@ -0,0 +1,432 @@ + + + + + +CommandLine.Model.PositionalParamSpec (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.Model.PositionalParamSpec

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine.Model
    +
    +
    +
    +
    public static class CommandLine.Model.PositionalParamSpec
    +extends CommandLine.Model.ArgSpec
    +
    The PositionalParamSpec class models aspects of a positional parameter of a command, including whether + it is required or optional, and attributes for the usage help message describing the positional parameter. +

    + Positional parameters have an index (or a range of indices). A positional parameter is matched when the parser + encounters a command line argument at that index. Named options and their parameters do not change the index counter, + so the command line can contain a mixture of positional parameters and named options. +

    + Depending on the positional parameter's arity, the parser may consume multiple command line + arguments starting from the current index. The parser will call setValue on + the PositionalParamSpec for each of the parameters encountered. + For multi-value positional parameters, the type may be an array, a Collection or a Map. In this case + the parser will get the data structure by calling getValue and modify the contents of this data structure. + (In the case of arrays, the array is replaced with a new instance with additional elements.) +

    + Before calling the setter, picocli converts the positional parameter value from a String to the parameter's type. +

    +
      +
    • If a positional parameter-specific converter is configured, this will be used for type conversion. + If the positional parameter's type is a Map, the map may have different types for its keys and its values, so + converters should provide two converters: one for the map keys and one for the map values.
    • +
    • Otherwise, the positional parameter's type is used to look up a converter in the list of + registered converters. For multi-value positional parameters, + the type may be an array, or a Collection or a Map. In that case the elements are converted + based on the positional parameter's auxiliaryTypes. The auxiliaryType is used to look up + the converter(s) to use to convert the individual parameter values. + Maps may have different types for its keys and its values, so auxiliaryTypes + should provide two types: one for the map keys and one for the map values.
    • +
    +

    + PositionalParamSpec objects are used by the picocli command line interpreter and help message generator. + Picocli can construct a PositionalParamSpec automatically from fields and methods with @Parameters + annotations. Alternatively a PositionalParamSpec can be constructed programmatically. +

    + When a PositionalParamSpec is created from a @Parameters -annotated field or method, + it is "bound" to that field or method: this field is set (or the method is invoked) when the position is matched + and setValue is called. + Programmatically constructed PositionalParamSpec instances will remember the value passed to the + setValue method so it can be retrieved with the getValue method. + This behaviour can be customized by installing a custom CommandLine.Model.IBinding on the PositionalParamSpec. +

    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.UnmatchedArgsBinding.html b/docs/apidocs/picocli/CommandLine.Model.UnmatchedArgsBinding.html new file mode 100644 index 000000000..23d7e022f --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.UnmatchedArgsBinding.html @@ -0,0 +1,308 @@ + + + + + +CommandLine.Model.UnmatchedArgsBinding (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.Model.UnmatchedArgsBinding

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine.Model
    +
    +
    +
    +
    public static class CommandLine.Model.UnmatchedArgsBinding
    +extends java.lang.Object
    +
    This class allows applications to specify a custom binding that will be invoked for unmatched arguments. + The specified binding is responsible for deciding how to consume the unmatched arguments.
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        forStringArraySupplier

        +
        public static CommandLine.Model.UnmatchedArgsBinding forStringArraySupplier(CommandLine.Model.IBinding binding)
        +
        Creates a UnmatchedArgsBinding for a binding that produces and consumes String[] objects.
        +
        +
        Parameters:
        +
        binding - Each new unmatched argument is added to the String[] array returned by the specified binding: a new String[] array with one extra element is created and set on the binding.
        +
        +
      • +
      + + + +
        +
      • +

        forStringListSupplier

        +
        public static CommandLine.Model.UnmatchedArgsBinding forStringListSupplier(CommandLine.Model.IBinding binding)
        +
        Creates a UnmatchedArgsBinding for a binding that produces and consumes List<String> objects.
        +
        +
        Parameters:
        +
        binding - Each new unmatched argument is added to the list returned by the specified binding. If the binding returns a null list, a new ArrayList is set on the binding.
        +
        +
      • +
      + + + + + + + +
        +
      • +

        binding

        +
        public CommandLine.Model.IBinding binding()
        +
        Returns the binding responsible for consuming the unmatched arguments.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.UsageMessageSpec.html b/docs/apidocs/picocli/CommandLine.Model.UsageMessageSpec.html new file mode 100644 index 000000000..50df7fb16 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.UsageMessageSpec.html @@ -0,0 +1,865 @@ + + + + + +CommandLine.Model.UsageMessageSpec (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.Model.UsageMessageSpec

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine.Model
    +
    +
    +
    +
    public static class CommandLine.Model.UsageMessageSpec
    +extends java.lang.Object
    +
    Models the usage help message specification.
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UsageMessageSpec

        +
        public UsageMessageSpec()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        headerHeading

        +
        public java.lang.String headerHeading()
        +
        Returns the optional heading preceding the header section. Initialized from CommandLine.Command.headerHeading(), or null.
        +
      • +
      + + + +
        +
      • +

        header

        +
        public java.lang.String[] header()
        +
        Returns the optional header lines displayed at the top of the help message. For subcommands, the first header line is + displayed in the list of commands. Values are initialized from CommandLine.Command.header() + if the Command annotation is present, otherwise this is an empty array and the help message has no + header. Applications may programmatically set this field to create a custom help message.
        +
      • +
      + + + +
        +
      • +

        synopsisHeading

        +
        public java.lang.String synopsisHeading()
        +
        Returns the optional heading preceding the synopsis. Initialized from CommandLine.Command.synopsisHeading(), "Usage: " by default.
        +
      • +
      + + + +
        +
      • +

        abbreviateSynopsis

        +
        public boolean abbreviateSynopsis()
        +
        Returns whether the synopsis line(s) should show an abbreviated synopsis without detailed option names.
        +
      • +
      + + + +
        +
      • +

        customSynopsis

        +
        public java.lang.String[] customSynopsis()
        +
        Returns the optional custom synopsis lines to use instead of the auto-generated synopsis. + Initialized from CommandLine.Command.customSynopsis() if the Command annotation is present, + otherwise this is an empty array and the synopsis is generated. + Applications may programmatically set this field to create a custom help message.
        +
      • +
      + + + +
        +
      • +

        descriptionHeading

        +
        public java.lang.String descriptionHeading()
        +
        Returns the optional heading preceding the description section. Initialized from CommandLine.Command.descriptionHeading(), or null.
        +
      • +
      + + + +
        +
      • +

        description

        +
        public java.lang.String[] description()
        +
        Returns the optional text lines to use as the description of the help message, displayed between the synopsis and the + options list. Initialized from CommandLine.Command.description() if the Command annotation is present, + otherwise this is an empty array and the help message has no description. + Applications may programmatically set this field to create a custom help message.
        +
      • +
      + + + + + + + +
        +
      • +

        optionListHeading

        +
        public java.lang.String optionListHeading()
        +
        Returns the optional heading preceding the options list. Initialized from CommandLine.Command.optionListHeading(), or null.
        +
      • +
      + + + +
        +
      • +

        sortOptions

        +
        public boolean sortOptions()
        +
        Returns whether the options list in the usage help message should be sorted alphabetically.
        +
      • +
      + + + +
        +
      • +

        requiredOptionMarker

        +
        public char requiredOptionMarker()
        +
        Returns the character used to prefix required options in the options list.
        +
      • +
      + + + +
        +
      • +

        showDefaultValues

        +
        public boolean showDefaultValues()
        +
        Returns whether the options list in the usage help message should show default values for all non-boolean options.
        +
      • +
      + + + +
        +
      • +

        hidden

        +
        public boolean hidden()
        +
        Returns whether this command should be hidden from the usage help message of the parent command.
        +
        +
        Returns:
        +
        true if this command should not appear in the usage help message of the parent command
        +
        +
      • +
      + + + +
        +
      • +

        commandListHeading

        +
        public java.lang.String commandListHeading()
        +
        Returns the optional heading preceding the subcommand list. Initialized from CommandLine.Command.commandListHeading(). "Commands:%n" by default.
        +
      • +
      + + + +
        +
      • +

        footerHeading

        +
        public java.lang.String footerHeading()
        +
        Returns the optional heading preceding the footer section. Initialized from CommandLine.Command.footerHeading(), or null.
        +
      • +
      + + + +
        +
      • +

        footer

        +
        public java.lang.String[] footer()
        +
        Returns the optional footer text lines displayed at the bottom of the help message. Initialized from + CommandLine.Command.footer() if the Command annotation is present, otherwise this is an empty array and + the help message has no footer. + Applications may programmatically set this field to create a custom help message.
        +
      • +
      + + + + + + + +
        +
      • +

        header

        +
        public CommandLine.Model.UsageMessageSpec header(java.lang.String... header)
        +
        Sets the optional header lines displayed at the top of the help message. For subcommands, the first header line is + displayed in the list of commands.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        synopsisHeading

        +
        public CommandLine.Model.UsageMessageSpec synopsisHeading(java.lang.String newValue)
        +
        Sets the optional heading preceding the synopsis.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        abbreviateSynopsis

        +
        public CommandLine.Model.UsageMessageSpec abbreviateSynopsis(boolean newValue)
        +
        Sets whether the synopsis line(s) should show an abbreviated synopsis without detailed option names.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        customSynopsis

        +
        public CommandLine.Model.UsageMessageSpec customSynopsis(java.lang.String... customSynopsis)
        +
        Sets the optional custom synopsis lines to use instead of the auto-generated synopsis.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        descriptionHeading

        +
        public CommandLine.Model.UsageMessageSpec descriptionHeading(java.lang.String newValue)
        +
        Sets the heading preceding the description section.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        description

        +
        public CommandLine.Model.UsageMessageSpec description(java.lang.String... description)
        +
        Sets the optional text lines to use as the description of the help message, displayed between the synopsis and the + options list.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        parameterListHeading

        +
        public CommandLine.Model.UsageMessageSpec parameterListHeading(java.lang.String newValue)
        +
        Sets the optional heading preceding the parameter list.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        optionListHeading

        +
        public CommandLine.Model.UsageMessageSpec optionListHeading(java.lang.String newValue)
        +
        Sets the heading preceding the options list.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        sortOptions

        +
        public CommandLine.Model.UsageMessageSpec sortOptions(boolean newValue)
        +
        Sets whether the options list in the usage help message should be sorted alphabetically.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        requiredOptionMarker

        +
        public CommandLine.Model.UsageMessageSpec requiredOptionMarker(char newValue)
        +
        Sets the character used to prefix required options in the options list.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        showDefaultValues

        +
        public CommandLine.Model.UsageMessageSpec showDefaultValues(boolean newValue)
        +
        Sets whether the options list in the usage help message should show default values for all non-boolean options.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        hidden

        +
        public CommandLine.Model.UsageMessageSpec hidden(boolean value)
        +
        Set the hidden flag on this command to control whether to show or hide it in the help usage text of the parent command.
        +
        +
        Parameters:
        +
        value - enable or disable the hidden flag
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        See Also:
        +
        CommandLine.Command.hidden()
        +
        +
      • +
      + + + +
        +
      • +

        commandListHeading

        +
        public CommandLine.Model.UsageMessageSpec commandListHeading(java.lang.String newValue)
        +
        Sets the optional heading preceding the subcommand list.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        footerHeading

        +
        public CommandLine.Model.UsageMessageSpec footerHeading(java.lang.String newValue)
        +
        Sets the optional heading preceding the footer section.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        footer

        +
        public CommandLine.Model.UsageMessageSpec footer(java.lang.String... footer)
        +
        Sets the optional footer text lines displayed at the bottom of the help message.
        +
        +
        Returns:
        +
        this UsageMessageSpec for method chaining
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Model.html b/docs/apidocs/picocli/CommandLine.Model.html new file mode 100644 index 000000000..258fde7f9 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Model.html @@ -0,0 +1,271 @@ + + + + + +CommandLine.Model (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.Model

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine
    +
    +
    +
    +
    public static final class CommandLine.Model
    +extends java.lang.Object
    +
    This class provides a namespace for classes and interfaces that model concepts and attributes of command line interfaces in picocli.
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class CommandLine.Model.ArgSpec + +
      static class CommandLine.Model.CommandSpec +
      The CommandSpec class models a command specification, including the options, positional parameters and subcommands + supported by the command, as well as attributes for the version help message and the usage help message of the command.
      +
      static interface CommandLine.Model.IBinding +
      Customizable binding for obtaining and modifying the current value of an option or positional parameter.
      +
      static class CommandLine.Model.OptionSpec +
      The OptionSpec class models aspects of a named option of a command, including whether + it is required or optional, the option parameters supported (or required) by the option, + and attributes for the usage help message describing the option.
      +
      static class CommandLine.Model.ParserSpec +
      Models parser configuration specification.
      +
      static class CommandLine.Model.PositionalParamSpec +
      The PositionalParamSpec class models aspects of a positional parameter of a command, including whether + it is required or optional, and attributes for the usage help message describing the positional parameter.
      +
      static class CommandLine.Model.UnmatchedArgsBinding +
      This class allows applications to specify a custom binding that will be invoked for unmatched arguments.
      +
      static class CommandLine.Model.UsageMessageSpec +
      Models the usage help message specification.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.ParseResult.Builder.html b/docs/apidocs/picocli/CommandLine.ParseResult.Builder.html new file mode 100644 index 000000000..1e543b818 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.ParseResult.Builder.html @@ -0,0 +1,375 @@ + + + + + +CommandLine.ParseResult.Builder (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.ParseResult.Builder

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine.ParseResult
    +
    +
    +
    +
    public static class CommandLine.ParseResult.Builder
    +extends java.lang.Object
    +
    Builds immutable ParseResult instances.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        build

        +
        public CommandLine.ParseResult build()
        +
        Creates and returns a new ParseResult instance for this builder's configuration.
        +
      • +
      + + + +
        +
      • +

        add

        +
        public CommandLine.ParseResult.Builder add(CommandLine.Model.ArgSpec arg,
        +                                           int position)
        +
        Adds the specified OptionSpec or PositionalParamSpec to the list of options and parameters + that were matched on the command line.
        +
        +
        Parameters:
        +
        arg - the matched OptionSpec or PositionalParamSpec
        +
        position - the command line position at which the PositionalParamSpec was matched. Ignored for OptionSpecs.
        +
        Returns:
        +
        this builder for method chaining
        +
        +
      • +
      + + + + + + + +
        +
      • +

        addPositionalParam

        +
        public CommandLine.ParseResult.Builder addPositionalParam(CommandLine.Model.PositionalParamSpec positionalParam,
        +                                                          int position)
        +
        Adds the specified PositionalParamSpec to the list of parameters that were matched on the command line.
        +
        +
        Parameters:
        +
        positionalParam - the matched PositionalParamSpec
        +
        position - the command line position at which the PositionalParamSpec was matched.
        +
        Returns:
        +
        this builder for method chaining
        +
        +
      • +
      + + + +
        +
      • +

        addUnmatched

        +
        public CommandLine.ParseResult.Builder addUnmatched(java.lang.String arg)
        +
        Adds the specified command line argument to the list of unmatched command line arguments.
        +
      • +
      + + + +
        +
      • +

        addUnmatched

        +
        public CommandLine.ParseResult.Builder addUnmatched(java.util.Stack<java.lang.String> args)
        +
        Adds all elements of the specified command line arguments stack to the list of unmatched command line arguments.
        +
      • +
      + + + + + + + +
        +
      • +

        originalArgs

        +
        public CommandLine.ParseResult.Builder originalArgs(java.lang.String[] originalArgs)
        +
        Sets the specified command line arguments that were parsed.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.ParseResult.html b/docs/apidocs/picocli/CommandLine.ParseResult.html new file mode 100644 index 000000000..0e4bab3c5 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.ParseResult.html @@ -0,0 +1,869 @@ + + + + + +CommandLine.ParseResult (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Class CommandLine.ParseResult

+
+
+ +
+
    +
  • +
    +
    Enclosing class:
    +
    CommandLine
    +
    +
    +
    +
    public static class CommandLine.ParseResult
    +extends java.lang.Object
    +
    Encapsulates the result of parsing an array of command line arguments.
    +
    +
    Since:
    +
    3.0
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class CommandLine.ParseResult.Builder +
      Builds immutable ParseResult instances.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.util.List<CommandLine>asCommandLineList() +
      Returns this ParseResult as a list of CommandLine objects, one for each matched command/subcommand.
      +
      static CommandLine.ParseResult.Builderbuilder(CommandLine.Model.CommandSpec commandSpec) +
      Creates and returns a new ParseResult.Builder for the specified command spec.
      +
      CommandLine.Model.CommandSpeccommandSpec() +
      Returns the CommandSpec for the matched command.
      +
      booleanhasOption(char shortName) +
      Returns whether an option whose aliases include the specified short name was matched on the command line.
      +
      booleanhasOption(CommandLine.Model.OptionSpec option) +
      Returns whether the specified option was matched on the command line.
      +
      booleanhasOption(java.lang.String name) +
      Returns whether an option whose aliases include the specified name was matched on the command line.
      +
      booleanhasPositional(CommandLine.Model.PositionalParamSpec positional) +
      Returns whether the specified positional parameter was matched on the command line.
      +
      booleanhasPositional(int position) +
      Returns whether a positional parameter was matched at the specified position.
      +
      booleanhasSubcommand() +
      Returns true if a subcommand was matched on the command line, false otherwise.
      +
      booleanisUsageHelpRequested() +
      Returns true if one of the options that was matched on the command line is a usageHelp option.
      +
      booleanisVersionHelpRequested() +
      Returns true if one of the options that was matched on the command line is a versionHelp option.
      +
      CommandLine.Model.OptionSpecoption(char shortName) +
      Returns the option with the specified short name, or null if no option with that name was matched on the command one.
      +
      CommandLine.Model.OptionSpecoption(java.lang.String name) +
      Returns the option with the specified name, or null if no option with that name was matched on the command one.
      +
      java.util.List<CommandLine.Model.OptionSpec>options() +
      Returns a list of matched options, in the order they were found on the command line.
      +
      <T> ToptionValue(char shortName, + T defaultValue) +
      Returns the command line argument value of the option with the specified name, converted to the type of the option, or the specified default value if no option with the specified name was matched.
      +
      <T> ToptionValue(CommandLine.Model.OptionSpec option, + T defaultValue) +
      Returns the command line argument value of the specified option, converted to the type of the option, or the specified default value if the specified option is null.
      +
      <T> ToptionValue(java.lang.String name, + T defaultValue) +
      Returns the command line argument value of the option with the specified name, converted to the type of the option, or the specified default value if no option with the specified name was matched.
      +
      java.util.List<java.lang.String>originalArgs() +
      Returns the command line arguments that were parsed.
      +
      CommandLine.Model.PositionalParamSpecpositional(int position) +
      Returns the PositionalParamSpec that was matched at the specified position, or null if no positional parameters were matched at that position.
      +
      java.util.List<CommandLine.Model.PositionalParamSpec>positionalParams() +
      Returns a list of matched positional parameters.
      +
      <T> TpositionalValue(CommandLine.Model.PositionalParamSpec positional, + T defaultValue) +
      Returns the command line argument value of the specified positional parameter, converted to the type of the positional parameter, or the specified default value if the specified positional parameter is null.
      +
      <T> TpositionalValue(int position, + T defaultValue) +
      Returns the command line argument value of the positional parameter at the specified position, converted to the type of the positional parameter, or the specified default value if no positional parameter was matched at that position.
      +
      java.lang.StringrawOptionValue(char shortName) +
      Returns the command line argument String value of the option with the specified name, or null if no option with the specified name was matched.
      +
      java.lang.StringrawOptionValue(char shortName, + java.lang.String defaultValue) +
      Returns the command line argument String value of the option with the specified name, or the specified default value if no option with the specified name was matched.
      +
      java.lang.StringrawOptionValue(CommandLine.Model.OptionSpec option) +
      Returns the command line argument String value of the specified option, or null if the specified option is null.
      +
      java.lang.StringrawOptionValue(CommandLine.Model.OptionSpec option, + java.lang.String defaultValue) +
      Returns the command line argument String value of the specified option, or the specified default value if the specified option is null.
      +
      java.lang.StringrawOptionValue(java.lang.String name) +
      Returns the command line argument String value of the option with the specified name, or null if no option with the specified name was matched.
      +
      java.lang.StringrawOptionValue(java.lang.String name, + java.lang.String defaultValue) +
      Returns the command line argument String value of the option with the specified name, or the specified default value if no option with the specified name was matched.
      +
      java.util.List<java.lang.String>rawOptionValues(char shortName) +
      Returns all command line argument String values matched for the option with the specified name, or an empty list if no option with the specified name was matched.
      +
      java.util.List<java.lang.String>rawOptionValues(CommandLine.Model.OptionSpec option) +
      Returns all command line argument String values matched for the specified option, or an empty list if the specified option is null.
      +
      java.util.List<java.lang.String>rawOptionValues(java.lang.String name) +
      Returns all command line argument String values matched for the option with the specified name, or an empty list if no option with the specified name was matched.
      +
      java.lang.StringrawPositionalValue(int position) +
      Returns the command line argument String value of the positional parameter at the specified position, or null if no positional parameter was matched at that position.
      +
      java.lang.StringrawPositionalValue(int position, + java.lang.String defaultValue) +
      Returns the command line argument String value of the positional parameter at the specified position, or the specified default value if no positional parameter was matched at that position.
      +
      CommandLine.ParseResultsubcommand() +
      Returns the ParseResult for the subcommand of this command that was matched on the command line, or null if no subcommand was matched.
      +
      java.util.List<java.lang.String>unmatched() +
      Returns a list of command line arguments that did not match any options or positional parameters.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        option

        +
        public CommandLine.Model.OptionSpec option(char shortName)
        +
        Returns the option with the specified short name, or null if no option with that name was matched on the command one.
        +
      • +
      + + + +
        +
      • +

        option

        +
        public CommandLine.Model.OptionSpec option(java.lang.String name)
        +
        Returns the option with the specified name, or null if no option with that name was matched on the command one.
        +
        +
        Parameters:
        +
        name - used to search the matched options. May be an alias of the option name that was actually specified on the command line. + The specified name may include option name prefix characters or not.
        +
        +
      • +
      + + + +
        +
      • +

        positional

        +
        public CommandLine.Model.PositionalParamSpec positional(int position)
        +
        Returns the PositionalParamSpec that was matched at the specified position, or null if no positional parameters were matched at that position.
        +
      • +
      + + + + + + + +
        +
      • +

        hasOption

        +
        public boolean hasOption(char shortName)
        +
        Returns whether an option whose aliases include the specified short name was matched on the command line.
        +
        +
        Parameters:
        +
        shortName - used to search the matched options. May be an alias of the option name that was actually specified on the command line.
        +
        +
      • +
      + + + +
        +
      • +

        hasOption

        +
        public boolean hasOption(java.lang.String name)
        +
        Returns whether an option whose aliases include the specified name was matched on the command line.
        +
        +
        Parameters:
        +
        name - used to search the matched options. May be an alias of the option name that was actually specified on the command line. + The specified name may include option name prefix characters or not.
        +
        +
      • +
      + + + +
        +
      • +

        hasOption

        +
        public boolean hasOption(CommandLine.Model.OptionSpec option)
        +
        Returns whether the specified option was matched on the command line.
        +
      • +
      + + + +
        +
      • +

        hasPositional

        +
        public boolean hasPositional(int position)
        +
        Returns whether a positional parameter was matched at the specified position.
        +
      • +
      + + + +
        +
      • +

        hasPositional

        +
        public boolean hasPositional(CommandLine.Model.PositionalParamSpec positional)
        +
        Returns whether the specified positional parameter was matched on the command line.
        +
      • +
      + + + +
        +
      • +

        options

        +
        public java.util.List<CommandLine.Model.OptionSpec> options()
        +
        Returns a list of matched options, in the order they were found on the command line.
        +
      • +
      + + + + + + + +
        +
      • +

        unmatched

        +
        public java.util.List<java.lang.String> unmatched()
        +
        Returns a list of command line arguments that did not match any options or positional parameters.
        +
      • +
      + + + +
        +
      • +

        originalArgs

        +
        public java.util.List<java.lang.String> originalArgs()
        +
        Returns the command line arguments that were parsed.
        +
      • +
      + + + +
        +
      • +

        rawOptionValue

        +
        public java.lang.String rawOptionValue(char shortName)
        +
        Returns the command line argument String value of the option with the specified name, or null if no option with the specified name was matched.
        +
      • +
      + + + +
        +
      • +

        rawOptionValue

        +
        public java.lang.String rawOptionValue(java.lang.String name)
        +
        Returns the command line argument String value of the option with the specified name, or null if no option with the specified name was matched.
        +
        +
        Parameters:
        +
        name - used to search the matched options. May be an alias of the option name that was actually specified on the command line. + The specified name may include option name prefix characters or not.
        +
        +
      • +
      + + + +
        +
      • +

        rawOptionValue

        +
        public java.lang.String rawOptionValue(CommandLine.Model.OptionSpec option)
        +
        Returns the command line argument String value of the specified option, or null if the specified option is null.
        +
      • +
      + + + +
        +
      • +

        rawOptionValue

        +
        public java.lang.String rawOptionValue(char shortName,
        +                                       java.lang.String defaultValue)
        +
        Returns the command line argument String value of the option with the specified name, or the specified default value if no option with the specified name was matched.
        +
      • +
      + + + +
        +
      • +

        rawOptionValue

        +
        public java.lang.String rawOptionValue(java.lang.String name,
        +                                       java.lang.String defaultValue)
        +
        Returns the command line argument String value of the option with the specified name, or the specified default value if no option with the specified name was matched.
        +
        +
        Parameters:
        +
        name - used to search the matched options. May be an alias of the option name that was actually specified on the command line. + The specified name may include option name prefix characters or not.
        +
        +
      • +
      + + + +
        +
      • +

        rawOptionValue

        +
        public java.lang.String rawOptionValue(CommandLine.Model.OptionSpec option,
        +                                       java.lang.String defaultValue)
        +
        Returns the command line argument String value of the specified option, or the specified default value if the specified option is null.
        +
      • +
      + + + +
        +
      • +

        rawPositionalValue

        +
        public java.lang.String rawPositionalValue(int position)
        +
        Returns the command line argument String value of the positional parameter at the specified position, or null if no positional parameter was matched at that position.
        +
      • +
      + + + +
        +
      • +

        rawPositionalValue

        +
        public java.lang.String rawPositionalValue(int position,
        +                                           java.lang.String defaultValue)
        +
        Returns the command line argument String value of the positional parameter at the specified position, or the specified default value if no positional parameter was matched at that position.
        +
      • +
      + + + +
        +
      • +

        rawOptionValues

        +
        public java.util.List<java.lang.String> rawOptionValues(char shortName)
        +
        Returns all command line argument String values matched for the option with the specified name, or an empty list if no option with the specified name was matched.
        +
      • +
      + + + +
        +
      • +

        rawOptionValues

        +
        public java.util.List<java.lang.String> rawOptionValues(java.lang.String name)
        +
        Returns all command line argument String values matched for the option with the specified name, or an empty list if no option with the specified name was matched.
        +
        +
        Parameters:
        +
        name - used to search the matched options. May be an alias of the option name that was actually specified on the command line. + The specified name may include option name prefix characters or not.
        +
        +
      • +
      + + + +
        +
      • +

        rawOptionValues

        +
        public java.util.List<java.lang.String> rawOptionValues(CommandLine.Model.OptionSpec option)
        +
        Returns all command line argument String values matched for the specified option, or an empty list if the specified option is null.
        +
      • +
      + + + + + +
        +
      • +

        optionValue

        +
        public <T> T optionValue(char shortName,
        +                         T defaultValue)
        +
        Returns the command line argument value of the option with the specified name, converted to the type of the option, or the specified default value if no option with the specified name was matched.
        +
      • +
      + + + + + +
        +
      • +

        optionValue

        +
        public <T> T optionValue(java.lang.String name,
        +                         T defaultValue)
        +
        Returns the command line argument value of the option with the specified name, converted to the type of the option, or the specified default value if no option with the specified name was matched.
        +
      • +
      + + + + + +
        +
      • +

        optionValue

        +
        public <T> T optionValue(CommandLine.Model.OptionSpec option,
        +                         T defaultValue)
        +
        Returns the command line argument value of the specified option, converted to the type of the option, or the specified default value if the specified option is null.
        +
      • +
      + + + + + +
        +
      • +

        positionalValue

        +
        public <T> T positionalValue(int position,
        +                             T defaultValue)
        +
        Returns the command line argument value of the positional parameter at the specified position, converted to the type of the positional parameter, or the specified default value if no positional parameter was matched at that position.
        +
      • +
      + + + + + +
        +
      • +

        positionalValue

        +
        public <T> T positionalValue(CommandLine.Model.PositionalParamSpec positional,
        +                             T defaultValue)
        +
        Returns the command line argument value of the specified positional parameter, converted to the type of the positional parameter, or the specified default value if the specified positional parameter is null.
        +
      • +
      + + + +
        +
      • +

        hasSubcommand

        +
        public boolean hasSubcommand()
        +
        Returns true if a subcommand was matched on the command line, false otherwise.
        +
      • +
      + + + +
        +
      • +

        subcommand

        +
        public CommandLine.ParseResult subcommand()
        +
        Returns the ParseResult for the subcommand of this command that was matched on the command line, or null if no subcommand was matched.
        +
      • +
      + + + +
        +
      • +

        isUsageHelpRequested

        +
        public boolean isUsageHelpRequested()
        +
        Returns true if one of the options that was matched on the command line is a usageHelp option.
        +
      • +
      + + + +
        +
      • +

        isVersionHelpRequested

        +
        public boolean isVersionHelpRequested()
        +
        Returns true if one of the options that was matched on the command line is a versionHelp option.
        +
      • +
      + + + +
        +
      • +

        asCommandLineList

        +
        public java.util.List<CommandLine> asCommandLineList()
        +
        Returns this ParseResult as a list of CommandLine objects, one for each matched command/subcommand.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/apidocs/picocli/CommandLine.Unmatched.html b/docs/apidocs/picocli/CommandLine.Unmatched.html new file mode 100644 index 000000000..b7e0d86b5 --- /dev/null +++ b/docs/apidocs/picocli/CommandLine.Unmatched.html @@ -0,0 +1,171 @@ + + + + + +CommandLine.Unmatched (picocli 3.0.0-alpha-1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
picocli
+

Annotation Type CommandLine.Unmatched

+
+
+
+
    +
  • +
    +
    +
    @Retention(value=RUNTIME)
    + @Target(value=FIELD)
    +public static @interface CommandLine.Unmatched
    +
    Fields annotated with @Unmatched will be initialized with the list of unmatched command line arguments, if any. + If this annotation is found, picocli automatically sets unmatchedArgumentsAllowed to true.
    +
    +
    Since:
    +
    3.0
    +
    See Also:
    +
    CommandLine.isUnmatchedArgumentsAllowed()
    +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/docs/picocli-3.0-programmatic-api.html b/docs/picocli-3.0-programmatic-api.html new file mode 100644 index 000000000..fcf74c3bd --- /dev/null +++ b/docs/picocli-3.0-programmatic-api.html @@ -0,0 +1,1050 @@ + + + + + + + +Programmatic API + + + + + + + +
+
+
+
+ + + + + +
+ + +For most applications the annotations API is a better fit than the programmatic API: the annotation syntax is more compact, easier to read, and easier to maintain. See this introductory article and for more details, the user manual. +
+
+
+

Picocli 3.0 offers a programmatic API for creating command line applications, in addition to annotations. The programmatic API allows applications to dynamically create command line options on the fly, and also makes it possible to create idiomatic domain-specific languages for processing command line arguments, using picocli, in other JVM languages.

+
+
+
+
+

1. Example

+
+
+
+
CommandSpec spec = CommandSpec.create();
+spec.mixinStandardHelpOptions(true); // usageHelp and versionHelp options
+spec.addOption(OptionSpec.builder("-c", "--count")
+        .paramLabel("COUNT")
+        .type(int.class)
+        .description("number of times to execute").build());
+spec.addPositional(PositionalParamSpec.builder()
+        .paramLabel("FILES")
+        .type(List.class)
+        .auxiliaryTypes(File.class) // List<File>
+        .description("The files to process").build());
+CommandLine commandLine = new CommandLine(spec);
+
+commandLine.parseWithSimpleHandlers(new AbstractSimpleParseResultHandler() {
+    public void handle(ParseResult pr) {
+        int count = pr.optionValue('c', 1);
+        List<File> files = pr.positionalValue(0, Collections.<File>emptyList());
+        for (int i = 0; i < count; i++) {
+            for (File f : files) {
+                System.out.printf("%d: %s%n", i, f);
+            }
+        }
+    }
+}, args);
+
+
+
+
+
+

2. Configuration

+
+
+

The following classes are the main model classes used to configure the parser:

+
+
+
    +
  • +

    CommandSpec

    +
  • +
  • +

    OptionSpec

    +
  • +
  • +

    PositionalParamSpec

    +
  • +
+
+
+

2.1. CommandSpec

+
+

2.1.1. Command Name and Version

+
+

CommandSpec models a command. It has a name and a version, both of which may be empty. For example:

+
+
+
+
CommandSpec cmd = CommandSpec.create()
+    .name("mycommand")
+    .version("My Command v1.0");
+
+
+
+

It also has a UsageMessageSpec to configure aspects of the usage help message.

+
+
+
+

2.1.2. Usage Help

+
+
+
cmd.usageMessage()
+        .headerHeading("Header heading%n")
+        .header("header line 1", "header line 2")
+        .descriptionHeading("Description heading%n")
+        .description("description line 1", "description line 2")
+        .optionListHeading("Options%n")
+        .parameterListHeading("Positional Parameters%n");
+        .footerHeading("Footer heading%n")
+        .footer("footer line 1", "footer line 2");
+
+
+
+

The ParserSpec can be used to control the behaviour of the parser to some extent.

+
+
+
+

2.1.3. Parser Options

+
+
+
cmd.parser()
+        .unmatchedArgumentsAllowed(true)
+        .overwrittenOptionsAllowed(true);
+
+
+
+
+

2.1.4. Mixins

+
+

CommandSpec has methods to add options (OptionSpec objects) and positional parameters (PositionalParamSpec objects). A CommandSpec can be mixed in with another CommandSpec, so its options, positional parameters and usage help attributes are merged into the other CommandSpec.

+
+
+
+
CommandSpec standardHelpOptions = CommandSpec.create()
+    .addOption(OptionSpec.builder("-h", "--help")
+        .usageHelp(true)
+        .description("Show this help message and exit.").build())
+    .addOption(OptionSpec.builder("-V", "--version")
+        .versionHelp(true)
+        .description("Print version information and exit.").build());
+
+CommandSpec cmd = CommandSpec.create()
+    .name("mycommand")
+    .addMixin("standardHelpOptions", standardHelpOptions);
+
+
+
+

Actually, since these options are extremely common, CommandSpec provides a convenience method to quickly add these standard help options:

+
+
+
+
CommandSpec spec = CommandSpec.create();
+spec.mixinStandardHelpOptions(true); // usageHelp and versionHelp options
+
+
+
+
+

2.1.5. Subcommands

+
+

Finally, CommandSpec objects can be subcommands of other CommandSpecs. There is no limit to the depth of a hierarchy of command and subcommands. CommandSpec also allows registration of type converters that are used while parsing the command line arguments to convert a command line argument string to the strongly typed value of a OptionSpec or PositionalParamSpec

+
+
+
+
CommandSpec helpSubcommand = CommandSpec.forAnnotatedObject(
+        new picocli.CommandLine.HelpCommand());
+
+CommandSpec cmd = CommandSpec.create()
+    .name("mycommand")
+    .addSubcommand("help", helpSubcommand);
+
+
+
+
+
+

2.2. OptionSpec

+
+

OptionSpec models a command option. An OptionSpec must have at least one name, which is used during parsing to match command line arguments. Other attributes can be left empty and picocli will give them a reasonable default value. This defaulting is why OptionSpec objects are created with a builder: this allows you to specify only some attributes and let picocli initialise the other attributes. For example, if only the option’s name is specified, picocli assumes the option takes no parameters (arity = 0), and is of type boolean. Another example, if arity is larger than 1, picocli sets the type to List and the auxiliary type to String.

+
+
+

Once an OptionSpec is constructed, its configuration becomes immutable, but its value can still be modified. Usually the value is set during command line parsing when a command line argument matches one of the option names.

+
+
+

The value is set via a binding. We’ll come back to bindings later in this document.

+
+
+

Similar to the annotation API, OptionSpec objects have help, usageHelp and versionHelp attributes. When the parser matches an option that was marked with any of these attributes, it will no longer validate that all required arguments exist. See the section below on the parseWithHandler(s) and parseWithSimpleHandler(s) methods that automatically print help when requested.

+
+
+
+

2.3. PositionalParamSpec

+
+

PositionalParamSpec objects don’t have names, but have an index range instead. A single PositionalParamSpec object can capture multiple positional parameters. The default index range is set to 0..* (all indices). A command may have multiple PositionalParamSpec objects to capture positional parameters at different index ranges. This can be useful if positional parameters at different index ranges have different data types.

+
+
+

Similar to OptionSpec objects, Once a PositionalParamSpec is constructed, its configuration becomes immutable, but its value can still be modified. Usually the value is set during command line parsing when a non-option command line argument is encountered at a position in its index range.

+
+
+

The value is set via a binding. We’ll look at bindings next.

+
+
+
+

2.4. Bindings

+
+

Bindings decouple the option and positional parameter specification from the place where their value is held.

+
+
+

Option specifications and positional parameter specifications created from annotated objects have a FieldBinding (and in the near future they can have a MethodBinding), so when the value is set on an option specification, the field’s value is set (or the setter method is invoked).

+
+
+

Option specifications and positional parameter specifications created programmatically without annotated object by default have an ObjectBinding that simply stores the value in a field of the ObjectBinding.

+
+
+

You may create a custom binding that delegates to some other data structure to retrieve and store the value.

+
+
+

Below is the IBinding interface definition:

+
+
+
+
public static interface IBinding {
+
+    /** Returns the current value of the binding. For multi-value options and positional
+     * parameters, this method returns an array, collection or map to add values to.
+     * @throws PicocliException if a problem occurred while obtaining the current value
+     */
+    <T> T get() throws PicocliException;
+
+    /** Sets the new value of the binding. For multi-value options and positional
+     * parameters, this method is used to set a new array instance that is one element
+     * larger than the previous instance, or to initialize the collection or map when
+     * the {@link #get() getter} returned {@code null}. For single-value options and
+     * positional parameters, this method simply sets the value.
+     *
+     * @param value the new value of the binding
+     * @param <T> type of the value
+     * @return the previous value of the binding (if supported by this binding)
+     * @throws PicocliException if a problem occurred while setting the new value
+     */
+    <T> T set(T value) throws PicocliException;
+}
+
+
+
+
+
+
+

3. Parse Result

+
+
+

For the below examples, we use the following parser configuration:

+
+
+
+
CommandSpec spec = CommandSpec.create();
+spec.addOption(OptionSpec.builder("-V", "--verbose").build());
+spec.addOption(OptionSpec.builder("-f", "--file")
+        .paramLabel("FILES")
+        .type(List.class)
+        .auxiliaryTypes(File.class) // so, this option is of type List<File>
+        .description("The files to process").build());
+CommandLine commandLine = new CommandLine(spec);
+
+
+
+

3.1. Querying for Options

+
+

The CommandLine::parseArgs method returns a ParseResult object that allows client code to query which options and positional parameters were matched for a given command.

+
+
+
+
String[] args = { "--verbose", "-f", "file1", "--file=file2" };
+ParseResult pr = commandLine.parseArgs(args);
+
+List<String> originalArgs = pr.originalArgs(); // lists all command line args
+assert Arrays.asList(args).equals(originalArgs);
+
+assert pr.hasOption("--verbose"); // as specified on command line
+assert pr.hasOption("-V");        // other aliases work also
+assert pr.hasOption('V');         // single-character alias works too
+assert pr.hasOption("verbose");   // and, command name without hyphens
+
+
+
+
+

3.2. Typed Option Values

+
+

The optionValue method returns the command line value or values, converted to the option’s type. This method requires a default value, which will be returned in case the option was not specified on the command line. In the above example, we defined the --file option to be of type List<File>, so we pass in an empty list as the default value:

+
+
+
+
ParseResult pr = commandLine.parseArgs("-f", "file1", "--file=file2");
+
+List<File> defaultValue = Collections.emptyList();
+List<File> expected     = Arrays.asList(new File("file1"), new File("file2"));
+
+assert expected.equals(pr.optionValue('f', defaultValue));
+assert expected.equals(pr.optionValue("--file", defaultValue));
+
+
+
+
+

3.3. Untyped Option Values

+
+

The rawOptionValue method returns the String argument specified on the command line. If the command line contains multiple arguments for this option, the first value is returned. Use the rawOptionValues method to get a list of all values specified on the command line for an option.

+
+
+
+
assert "file1".equals(pr.rawOptionValue('f'));       // single-character alias
+assert "file1".equals(pr.rawOptionValue("-f"));      // short name
+assert "file1".equals(pr.rawOptionValue("--file"));  // long name
+
+List<String> expected = Arrays.asList("file1", "file2");
+assert expected.equals(pr.rawOptionValues("f"));     // short name without hyphens
+assert expected.equals(pr.rawOptionValues("file"));  // long name without hyphens
+
+
+
+
+

3.4. Subcommands

+
+

Use the hasSubcommand method to determine whether the command line contained subcommands. The subcommand method returns a different ParseResult object that can be used to query which options and positional parameters were matched for the subcommand.

+
+
+
+
class App {
+    @Option(names = "-x") String x;
+}
+class Sub {
+    @Parameters String[] all;
+}
+CommandLine cmd = new CommandLine(new App());
+cmd.addSubcommand("sub", new Sub());
+ParseResult parseResult = cmd.parseArgs("-x", "xval", "sub", "1", "2", "3");
+
+assert parseResult.hasOption("-x");
+assert "xval".equals(parseResult.optionValue("-x", "default"));
+
+assert parseResult.hasSubcommand();
+ParseResult subResult = parseResult.subcommand();
+
+assert  subResult.hasPositional(0);
+assert  subResult.hasPositional(1);
+assert  subResult.hasPositional(2);
+assert !subResult.hasPositional(3);
+assert "1".equals(subResult.rawPositionalValue(0));
+assert "2".equals(subResult.rawPositionalValue(1));
+assert "3".equals(subResult.rawPositionalValue(2));
+
+
+
+
+
+
+

4. Parsing and Result Processing

+
+
+

4.1. Basic Processing

+
+

The most basic way to parse the command line is to call the CommandLine::parseArgs method and inspect the resulting ParseResult object.

+
+
+

For example:

+
+
+
+
CommandSpec spec = CommandSpec.create();
+// add options and positional parameters
+
+CommandLine commandLine = new CommandLine(spec);
+try {
+    ParseResult pr = commandLine.parseArgs(args);
+    if (CommandLine.printHelpIfRequested(pr)) {
+        return;
+    }
+    int count = pr.optionValue('c', 1);
+    List<File> files = pr.positionalValue(0, Collections.<File>emptyList());
+    for (int i = 0; i < count; i++) {
+        for (File f : files) {
+            System.out.printf("%d: %s%n", i, f);
+        }
+    }
+} catch (ParseException invalidInput) {
+    System.err.println(invalidInput.getMessage());
+    invalidInput.getCommandLine().usage(System.err);
+}
+
+
+
+
+

4.2. Convenience Methods

+
+

There are a number of parseWithHandler convenience methods to reduce some boilerplate when processing the ParseResult programmatically. The convenience methods take care of printing help when requested by the user, and handle invalid input.

+
+
+

4.2.1. Handlers Without Return Value

+
+

Call the parseWithSimpleHandler method with a AbstractSimpleParseResultHandler subclass to process the parse result without returning a result value. Note the absence of error handling and checking of whether the user requested help. The handle method contains only your business logic.

+
+
+

Example:

+
+
+
+
CommandSpec spec = CommandSpec.create();
+// add options and positional parameters
+
+CommandLine commandLine = new CommandLine(spec);
+commandLine.parseWithSimpleHandler(new AbstractSimpleParseResultHandler() {
+    public void handle(ParseResult pr) {
+        int count = pr.optionValue('c', 1);
+        List<File> files = pr.positionalValue(0, Collections.<File>emptyList());
+        for (int i = 0; i < count; i++) {
+            for (File f : files) {
+                System.out.printf("%d: %s%n", i, f);
+            }
+        }
+    }
+}, args);
+
+
+
+

A variation of this method, parseWithSimpleHandlers, additionally takes an IExceptionHandler2<Void> to customize how invalid input should be handled and optionally set an exit code for when the input was invalid.

+
+
+

Example:

+
+
+
+
CommandSpec spec = CommandSpec.create();
+// add options and positional parameters
+
+CommandLine commandLine = new CommandLine(spec);
+commandLine.parseWithSimpleHandlers(new AbstractSimpleParseResultHandler() {
+    public void handle(ParseResult pr) {...}
+}.useOut(System.out).andExit(123),
+        new DefaultExceptionHandler<Void>().andExit(567),
+        args);
+
+
+
+
+

4.2.2. Handlers with Return Value

+
+

It is possible for the parse result processing logic to return a result. To accomplish this, call the CommandLine::parseWithHandler method with a class that extends AbstractParseResultHandler and a prototype return value. The process method may return a completely different return value object (as long as it has the correct type) or it can modify the return value object that was passed in to the parseWithHandler method.

+
+
+

Example:

+
+
+
+
CommandSpec spec = CommandSpec.create();
+// add options and positional parameters
+
+CommandLine commandLine = new CommandLine(spec);
+
+class MyResult {
+    List<File> files = new ArrayList<File>();
+}
+
+class MyHandler extends AbstractParseResultHandler<MyResult> {
+    public MyResult handle(ParseResult pr, MyResult returnValue) {
+        int count = pr.optionValue('c', 1);
+        List<File> files = pr.positionalValue(0, Collections.<File>emptyList());
+        for (File f : files) {
+            for (int i = 0; i < count; i++) {
+                returnValue.files.add(f);
+            }
+        }
+        return returnValue;
+    }
+    protected MyHandler self() { return this; }
+}
+
+MyResult result = commandLine.parseWithHandler(new MyHandler(), new MyResult(), args);
+// do something with result...
+
+
+
+

This method also has a variation, parseWithHandlers, which additionally takes an IExceptionHandler2<MyResult> to customize how invalid input should be handled and optionally set an exit code.

+
+
+

Example:

+
+
+
+
CommandSpec spec = CommandSpec.create();
+// add options and positional parameters
+
+CommandLine commandLine = new CommandLine(spec);
+MyResult result = commandLine.parseWithHandler(
+        new MyHandler().useOut(System.out).andExit(123),
+        new MyResult(),
+        new DefaultExceptionHandler<MyResult>().andExit(567),
+        args);
+// do something with result...
+
+
+
+
+
+
+
+ + + \ No newline at end of file