elek commented on a change in pull request #687: HDDS-2184. Rename ozone scmcli 
to ozone admin
URL: https://github.com/apache/hadoop-ozone/pull/687#discussion_r397875948
 
 

 ##########
 File path: 
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/SafeModeCommands.java
 ##########
 @@ -46,15 +48,15 @@
       LoggerFactory.getLogger(SafeModeCommands.class);
 
   @ParentCommand
-  private SCMCLI parent;
+  private WithScmClient parent;
 
-  public SCMCLI getParent() {
+  public WithScmClient getParent() {
     return parent;
   }
 
   @Override
   public Void call() throws Exception {
     throw new MissingSubcommandException(
-        this.parent.getCmd().getSubcommands().get("safemode"));
+        new CommandLine(new SafeModeCommands()));
 
 Review comment:
   I agree with you about the usability benefit, but I deleted it 
intentionally. I don't like that we have a strong dependency on the parent 
command (getCmd() should be available) and it was not easy to keep it as from 
now, we have subcommands in multiple subprojects (eg. ozone-tools, hdds-tools)
   
   Fortunately I found an other way to get the desired output: It runed out 
that it's enough to have a `CommandSpec` reference which can be injected with 
`@Spec`. I updated the subcommand, and it works again:
   
   ```
   Incomplete command
   Usage: ozone admin safemode [-hV] [COMMAND]
   Safe mode specific operations
     -h, --help      Show this help message and exit.
     -V, --version   Print version information and exit.
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to