Class StandardOptions

java.lang.Object
software.amazon.smithy.cli.StandardOptions
All Implemented Interfaces:
ArgumentReceiver

public final class StandardOptions extends Object implements ArgumentReceiver
Options available to all commands.
  • Field Details

  • Constructor Details

    • StandardOptions

      public StandardOptions()
  • Method Details

    • registerHelp

      public void registerHelp(HelpPrinter printer)
      Description copied from interface: ArgumentReceiver
      Registers help information to the given HelpPrinter.
      Specified by:
      registerHelp in interface ArgumentReceiver
      Parameters:
      printer - Printer to modify.
    • testOption

      public boolean testOption(String name)
      Description copied from interface: ArgumentReceiver
      Test if the given value-less option is accepted by the receiver.

      If the option is accepted, the receiver should store a stateful value to indicate the option was received, and the CLI will skip the argument for further processing.

      Specified by:
      testOption in interface ArgumentReceiver
      Parameters:
      name - Name of the option to test.
      Returns:
      Returns true if accepted.
    • testParameter

      public Consumer<String> testParameter(String name)
      Description copied from interface: ArgumentReceiver
      Test if the given parameter that requires a value is accepted by the receiver.

      If the parameter is accepted, the receiver returns a Consumer that receives the expected value, and it should store a stateful value to allow the value to be later recalled. The CLI will skip the argument for further processing.

      Specified by:
      testParameter in interface ArgumentReceiver
      Parameters:
      name - Name of the parameter to test.
      Returns:
      Returns a consumer if accepted or null if rejected.
    • help

      public boolean help()
    • logging

      public Level logging()
    • quiet

      public boolean quiet()
    • debug

      public boolean debug()
    • stackTrace

      public boolean stackTrace()
    • colorSetting

      public AnsiColorFormatter colorSetting()