Package org.apache.oodt.cas.cli.option

Examples of org.apache.oodt.cas.cli.option.GroupCmdLineOption


      };
   }

   public static GroupCmdLineOption createGroupOption(String longName,
         boolean required) {
      GroupCmdLineOption option = new GroupCmdLineOption();
      option.setLongOption(longName);
      option.setShortOption(longName);
      option.setRequired(required);
      return option;
   }
View Full Code Here


      for (CmdLineOption option : options) {
         if (isActionOption(option)) {
            return (ActionCmdLineOption) option;
         } else if (isGroupOption(option)) {
            GroupCmdLineOption groupOption = (GroupCmdLineOption) option;
            Set<CmdLineOption> subOptions = Sets.newHashSet();
            for (GroupSubOption subOption : groupOption.getSubOptions()) {
               subOptions.add(subOption.getOption());
            }
            ActionCmdLineOption foundOption = findFirstActionOption(subOptions);
            if (foundOption != null) {
               return foundOption;
View Full Code Here

      List<ActionCmdLineOption> actionOptions = Lists.newArrayList();
      for (CmdLineOption option : options) {
         if (isActionOption(option)) {
            actionOptions.add((ActionCmdLineOption) option);
         } else if (isGroupOption(option)) {
            GroupCmdLineOption groupOption = (GroupCmdLineOption) option;
            Set<CmdLineOption> subOptions = Sets.newHashSet();
            for (GroupSubOption subOption : groupOption.getSubOptions()) {
               subOptions.add(subOption.getOption());
            }
            actionOptions.addAll(findActionOptions(subOptions));
         }
      }
View Full Code Here

                     + getFormattedString("Handler:", 62, 113)
                     + getFormattedString(handlerHelp, 63, 113);
            }
         }
      } else if (isGroupOption(option)) {
         GroupCmdLineOption groupOption = asGroupOption(option);
         optionUsage += "\n";
         optionUsage += "   SubOptions:\n";
         optionUsage += "   > Required:\n";

         List<CmdLineOption> optionalOptions = Lists.newArrayList();
         for (GroupSubOption subOption : groupOption.getSubOptions()) {
            if (subOption.isRequired()) {
               optionUsage += getOptionHelp(subOption.getOption(), "     ");
            } else {
               optionalOptions.add(subOption.getOption());
            }
View Full Code Here

            actionOptionInst.getOption().getLongOption(), optionInsts));
   }

   public void testIsSubOption() {
      CmdLineOption subOption = createSimpleOption("test", false);
      GroupCmdLineOption groupOption = createGroupOption("group", false);
      assertFalse(CmdLineUtils.isSubOption(groupOption, subOption));

      groupOption.addSubOption(new GroupSubOption(subOption, false));
      assertTrue(CmdLineUtils.isSubOption(groupOption, subOption));
   }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.cli.option.GroupCmdLineOption

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.