jkosh44 commented on a change in pull request #1083: Command module with
centralized Command Pattern logic
URL: https://github.com/apache/fluo/pull/1083#discussion_r365033594
##########
File path:
modules/command/src/main/java/org/apache/fluo/command/AppCommand.java
##########
@@ -16,19 +16,25 @@
package org.apache.fluo.command;
import com.beust.jcommander.Parameter;
+import org.apache.fluo.api.config.FluoConfiguration;
-class CommonOpts extends ConfigOpts {
+abstract class AppCommand extends ConfigCommand {
@Parameter(names = "-a", required = true, description = "Fluo application
name")
private String applicationName;
+ @Override
+ FluoConfiguration getConfig() {
+ FluoConfiguration config = super.getConfig();
+ config.setApplicationName(applicationName);
+ return config;
+ }
+
String getApplicationName() {
return applicationName;
}
- public static CommonOpts parse(String programName, String[] args) {
- CommonOpts opts = new CommonOpts();
- parse(programName, opts, args);
- return opts;
+ void setApplicationName(String applicationName) {
Review comment:
I meant to standardize how all of the options are handled but I forgot to. I
wanted them all to be private fields with a public getter and setter method.
The reason for this is because if the commands are going to be used outside of
the CLI, I wanted to provide a way to set the options without having to use
Reflection.
This reply applies for your comment on `setProperties` too.
What are you thoughts?
----------------------------------------------------------------
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]
With regards,
Apache Git Services