Class OptionHandler

java.lang.Object
org.springframework.boot.cli.command.options.OptionHandler

public class OptionHandler extends Object
Delegate used by OptionParsingCommand to parse options and run the command.
Since:
1.0.0
Author:
Dave Syer
See Also:
  • Constructor Details

    • OptionHandler

      public OptionHandler()
      Create a new OptionHandler instance.
    • OptionHandler

      public OptionHandler(Function<String,String> argumentProcessor)
      Create a new OptionHandler instance with an argument processor.
      Parameters:
      argumentProcessor - strategy that can be used to manipulate arguments before they are used.
  • Method Details

    • option

      public joptsimple.OptionSpecBuilder option(String name, String description)
    • option

      public joptsimple.OptionSpecBuilder option(List<String> aliases, String description)
    • getParser

      public joptsimple.OptionParser getParser()
    • options

      protected void options()
    • run

      public final ExitStatus run(String... args) throws Exception
      Throws:
      Exception
    • run

      protected ExitStatus run(joptsimple.OptionSet options) throws Exception
      Run the command using the specified parsed OptionSet.
      Parameters:
      options - the parsed option set
      Returns:
      an ExitStatus
      Throws:
      Exception - in case of errors
    • getHelp

      public String getHelp()
    • getOptionsHelp

      public Collection<OptionHelp> getOptionsHelp()