keith-turner commented on a change in pull request #1083: Command module with 
centralized Command Pattern logic
URL: https://github.com/apache/fluo/pull/1083#discussion_r365362982
 
 

 ##########
 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:
   > The reason for this is because if the commands are going to be used 
outside of the CLI
   
   Do you have a specific use case for that in mind?
   
   > What are you thoughts?
   
   This internal non-API code so we can change it at anytime, which is nice.  
We can commit this now, release Fluo 2.0.0, and then change this w/o any 
problem.  
   
   There is a balancing act between making what you are committing now more 
understandable for others and committing things in a partially done state 
because you know you will work on it in the future.  Whatever you think is best 
I am ok with.

----------------------------------------------------------------
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

Reply via email to