public StartParameter convert(ParsedCommandLine options, StartParameter startParameter) throws CommandLineArgumentException {
LoggingConfiguration loggingConfiguration = loggingConfigurationCommandLineConverter.convert(options);
startParameter.setLogLevel(loggingConfiguration.getLogLevel());
startParameter.setColorOutput(loggingConfiguration.isColorOutput());
FileResolver resolver = new BaseDirConverter(startParameter.getCurrentDir());
for (String keyValueExpression : options.option(SYSTEM_PROP).getValues()) {
String[] elements = keyValueExpression.split("=");
startParameter.getSystemPropertiesArgs().put(elements[0], elements.length == 1 ? "" : elements[1]);
}
for (String keyValueExpression : options.option(PROJECT_PROP).getValues()) {
String[] elements = keyValueExpression.split("=");
startParameter.getProjectProperties().put(elements[0], elements.length == 1 ? "" : elements[1]);
}
if (options.hasOption(NO_SEARCH_UPWARDS)) {
startParameter.setSearchUpwards(false);
}
if (options.hasOption(PROJECT_DIR)) {
startParameter.setProjectDir(resolver.resolve(options.option(PROJECT_DIR).getValue()));
}
if (options.hasOption(GRADLE_USER_HOME)) {
startParameter.setGradleUserHomeDir(resolver.resolve(options.option(GRADLE_USER_HOME).getValue()));
}
if (options.hasOption(BUILD_FILE)) {
startParameter.setBuildFile(resolver.resolve(options.option(BUILD_FILE).getValue()));
}
if (options.hasOption(SETTINGS_FILE)) {
startParameter.setSettingsFile(resolver.resolve(options.option(SETTINGS_FILE).getValue()));
}
for (String script : options.option(INIT_SCRIPT).getValues()) {
startParameter.addInitScript(resolver.resolve(script));
}
if (options.hasOption(CACHE)) {
try {
startParameter.setCacheUsage(CacheUsage.fromString(options.option(CACHE).getValue()));