Package software.amazon.smithy.cli
Interface ArgumentReceiver
- 
- All Known Implementing Classes:
- StandardOptions
 
 public interface ArgumentReceiverA command line argument receiver.All non-positional arguments of a Commandneed a corresponding receiver to accept it through eithertestOption(String)ortestParameter(String). If any receiver rejects a non-positional argument, the CLI will exit with an error.
- 
- 
Method SummaryAll Methods Instance Methods Default Methods Modifier and Type Method Description default voidregisterHelp(HelpPrinter printer)Registers help information to the givenHelpPrinter.default booleantestOption(java.lang.String name)Test if the given value-less option is accepted by the receiver.default java.util.function.Consumer<java.lang.String>testParameter(java.lang.String name)Test if the given parameter that requires a value is accepted by the receiver.
 
- 
- 
- 
Method Detail- 
testOptiondefault boolean testOption(java.lang.String name) 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. - Parameters:
- name- Name of the option to test.
- Returns:
- Returns true if accepted.
 
 - 
testParameterdefault java.util.function.Consumer<java.lang.String> testParameter(java.lang.String name) 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. - Parameters:
- name- Name of the parameter to test.
- Returns:
- Returns a consumer if accepted or null if rejected.
 
 - 
registerHelpdefault void registerHelp(HelpPrinter printer) Registers help information to the givenHelpPrinter.- Parameters:
- printer- Printer to modify.
 
 
- 
 
-