enapps-enorman commented on a change in pull request #24:
URL:
https://github.com/apache/sling-org-apache-sling-feature-launcher/pull/24#discussion_r613467368
##########
File path: src/main/java/org/apache/sling/feature/launcher/impl/Main.java
##########
@@ -264,20 +270,23 @@ protected static void parseArgs(final LauncherConfig
config, final String[] args
config.getConfigClashOverrides().put(name,
cfgCProps.getProperty(name));
}
- Properties fwProps =
cl.getOptionProperties(OPT_FRAMEWORK_PROPERTIES);
- for (final String name : fwProps.stringPropertyNames()) {
- config.getInstallation()
- .getFrameworkProperties()
- .put(name, fwProps.getProperty(name));
- }
+ extractValuesFromOption(cl,
OPT_FRAMEWORK_PROPERTIES).orElseGet(ArrayList::new)
+ .forEach(value -> {
+ final String[] keyVal = split(value);
+
config.getInstallation().getFrameworkProperties().put(keyVal[0], keyVal[1]);
+ });
Properties varProps = cl.getOptionProperties(OPT_VARIABLE_VALUES);
for (final String name : varProps.stringPropertyNames()) {
config.getVariables().put(name, varProps.getProperty(name));
}
- extractValueFromOption(cl, OPT_VERBOSE, "debug").ifPresent(
- value ->
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", value));
+ if (cl.hasOption(OPT_VERBOSE)) {
+ extractValueFromOption(cl, OPT_VERBOSE,
"debug").ifPresent(value -> System
Review comment:
It's better. How would you feel about maybe throwing a ParseException
when the logLevel is invalid so it fails fast and does the printHelp call?
Also, it would be good to say what the valid values are in the printHelp
output for the verbose option
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]