Java Code Examples for org.apache.commons.cli.Option#getValuesList()
The following examples show how to use
org.apache.commons.cli.Option#getValuesList() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FHIRCLI.java From FHIR with Apache License 2.0 | 5 votes |
/** * Visits each "header" option and adds it to the InvocationContext. */ private void collectHeaders(CommandLine cmdline, InvocationContext ic) { for (Option option : cmdline.getOptions()) { if (option.getOpt().equals(OptionNames.HEADER.getShortName())) { List<String> values = option.getValuesList(); if (values != null && values.size() >= 2) { ic.addHeader(values.get(0), values.get(1)); } } } }
Example 2
Source File: FHIRCLI.java From FHIR with Apache License 2.0 | 5 votes |
/** * Visits each "queryParameter" option and adds it to the InvocationContext. */ private void collectQueryParameters(CommandLine cmdline, InvocationContext ic) { for (Option option : cmdline.getOptions()) { if (option.getOpt().equals(OptionNames.QUERYPARAMETER.getShortName())) { List<String> values = option.getValuesList(); if (values != null && values.size() >= 2) { ic.addQueryParameter(values.get(0), values.get(1)); } } } }