void (CommandLineParser parser) { systemPropertiesCommandLineConverter.configure(parser); parser.allowMixedSubcommandsAndOptions(); parser.allowUnknownOptions(); //noinspection unchecked final Collection<Option> supportedOptions = GradleCommandLineOptionsProvider.getSupportedOptions().getOptions(); for (Option supportedOption : supportedOptions) { final List<String> objects = new SmartList<>(); ContainerUtil.addAllNotNull(objects, supportedOption.getOpt(), supportedOption.getLongOpt()); if (!objects.isEmpty()) { try { final CommandLineOption option = parser.option(ArrayUtilRt.toStringArray(objects)); if (supportedOption.hasArg()) { option.hasArgument(); } if (supportedOption.hasArgs()) { option.hasArguments(); } option.hasDescription(supportedOption.getDescription()); } catch (IllegalArgumentException ignore) { } } } }