Uploaded image for project: 'Aesh'
  1. Aesh
  2. AESH-307

CommandInvocation#getHelpInfo fails for commands within a @GroupCommandDefinition

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 0.58
    • None
    • None
    • None

      @CommandDefinition(name = "get", description = "\n")
      public class GetOntologyCommand extends AbstractOntologyCommand {
      
      	...
      
      	@Option(shortName = 'h', name = "help", hasValue = false, required = false, overrideRequired = true,
      			description = "Display help")
      	private boolean help;
      
          @GroupCommandDefinition(name = "ontology", description = "",
                  groupCommands = {GetOntologyCommand.class, ...})
          public static class OntologyCommands implements Command {
              @Override
              public CommandResult execute(CommandInvocation commandInvocation) throws IOException, InterruptedException {
                  return CommandResult.SUCCESS;
              }
          }
      
      commandInvocation.getShell().out().println(commandInvocation.getHelpInfo("get"));
      

      That prints out an empty line when --help is used. Note that "ontology get <TAB> does successfully print out all the options.

              spederse@redhat.com Stale Pedersen
              brmeyer_jira Brett Meyer (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: