keith-turner commented on a change in pull request #1083: [WIP] POC for Command 
module with centralized Command Pattern logic
URL: https://github.com/apache/fluo/pull/1083#discussion_r357780270
 
 

 ##########
 File path: modules/command/src/main/java/org/apache/fluo/command/FluoList.java
 ##########
 @@ -18,18 +18,18 @@
 import java.util.Collections;
 import java.util.List;
 
+import com.beust.jcommander.Parameters;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.fluo.api.config.FluoConfiguration;
 import org.apache.fluo.core.client.FluoAdminImpl;
 import org.apache.fluo.core.util.CuratorUtil;
 
-public class FluoList {
+@Parameters(commandDescription = "Lists all Fluo applications in Fluo 
instance")
+public class FluoList extends ConfigCommand {
 
-  public static void main(String[] args) throws Exception {
-
-    ConfigOpts commandOpts = ConfigOpts.parse("fluo list", args);
+  public void list() {
     FluoConfiguration config = CommandUtil.resolveFluoConfig();
-    commandOpts.overrideFluoConfig(config);
+    overrideFluoConfig(config);
 
 Review comment:
   Seeing this pattern repeated I was wondering if it would make sense for the 
super class to have a method like.
   
   ```java
   FluoConfiguration getConfig() {
     FluoConfiguration config = CommandUtil.resolveFluoConfig();
     overrideFluoConfig(config);
     return config.
   }
   ```
   
   Not sure if this is good idea because I have not looked into what 
`resolveFluoConfig()` does.

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