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_r365623258
 
 

 ##########
 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 use case I have in mind is if we ever want to wrap the commands in some 
type of UI as mentioned in the original issue.
   
   I think I'll make your suggested changes and we should be good to merge. I 
can figure out how to set the options in a follow up PR.

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