test_class.declarator: UPLOAD_CONSTRUCT_OPTION = "u"
test_class.modifier: private static final
test_class.original_string: private static final String UPLOAD_CONSTRUCT_OPTION = "u";
test_class.type: String
test_class.var_name: UPLOAD_CONSTRUCT_OPTION
test_class.declarator: DIRECTORY_OPTION = "d"
test_class.modifier: private static final
test_class.original_string: private static final String DIRECTORY_OPTION = "d";
test_class.type: String
test_class.var_name: DIRECTORY_OPTION
test_class.declarator: OVERWRITE_OPTION = "o"
test_class.modifier: private static final
test_class.original_string: private static final String OVERWRITE_OPTION = "o";
test_class.type: String
test_class.var_name: OVERWRITE_OPTION
test_class.declarator: VERBOSE_OPTION = "v"
test_class.modifier: private static final
test_class.original_string: private static final String VERBOSE_OPTION = "v";
test_class.type: String
test_class.var_name: VERBOSE_OPTION
test_class.declarator: UPLOAD_LONG_OPTION = "upload"
test_class.modifier: private static final
test_class.original_string: private static final String UPLOAD_LONG_OPTION = "upload";
test_class.type: String
test_class.var_name: UPLOAD_LONG_OPTION
test_class.declarator: VERBOSE_LONG_OPTION = "verbose"
test_class.modifier: private static final
test_class.original_string: private static final String VERBOSE_LONG_OPTION = "verbose";
test_class.type: String
test_class.var_name: VERBOSE_LONG_OPTION
test_class.declarator: OVERWRITE_LONG_OPTION = "overwrite"
test_class.modifier: private static final
test_class.original_string: private static final String OVERWRITE_LONG_OPTION = "overwrite";
test_class.type: String
test_class.var_name: OVERWRITE_LONG_OPTION
test_class.declarator: DIRECTORY_LONG_OPTION = "directory"
test_class.modifier: private static final
test_class.original_string: private static final String DIRECTORY_LONG_OPTION = "directory";
test_class.type: String
test_class.var_name: DIRECTORY_LONG_OPTION
test_class.file: kb-importer/src/test/java/org/eclipse/steady/kb/command/CommandParserTest.java
test_class.identifier: CommandParserTest
test_case.body: @Test
    public void testParse() throws CommandLineParserException {
      Options options = new Options();
      options.addRequiredOption(
          DIRECTORY_OPTION,
          DIRECTORY_LONG_OPTION,
          true,
          "directory containing mutiple commit folders with meta files");
      options.addOption(
          OVERWRITE_OPTION,
          OVERWRITE_LONG_OPTION,
          false,
          "overwrite the bug if it already exists in the backend");
      options.addOption(VERBOSE_OPTION, VERBOSE_LONG_OPTION, false, "Verbose mode");
      options.addOption(
          UPLOAD_CONSTRUCT_OPTION, UPLOAD_LONG_OPTION, false, "Upload construct changes");
  
      String _args = "-d test -u -v";
      HashMap<String, Object> parsedCommands = CommandParser.parse(_args.split(" "), options);
      assertEquals("test", parsedCommands.get(DIRECTORY_OPTION));
      assertTrue((boolean) parsedCommands.get(VERBOSE_OPTION));
      assertTrue((boolean) parsedCommands.get(UPLOAD_CONSTRUCT_OPTION));
      assertFalse((boolean) parsedCommands.get(OVERWRITE_OPTION));
    }
test_case.class_method_signature: CommandParserTest.testParse()
test_case.full_signature: @Test public void testParse()
test_case.identifier: testParse
test_case.invocations: addRequiredOption addOption addOption addOption parse split assertEquals get assertTrue get assertTrue get assertFalse get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParse()
focal_class.file: kb-importer/src/main/java/org/eclipse/steady/kb/command/CommandParser.java
focal_class.identifier: CommandParser
focal_class.class_method_signature: CommandParser.parse(String[] _args, Options options)
focal_class.full_signature: public static HashMap<String, Object> parse(String[] _args, Options options)
focal_class.identifier: parse
focal_class.modifiers: public static
focal_class.parameters: (String[] _args, Options options)
focal_class.return: HashMap<String, Object>
focal_class.signature: HashMap<String, Object> parse(String[] _args, Options options)
focal_method.body: public static HashMap<String, Object> parse(String[] _args, Options options)
        throws CommandLineParserException {
      final CommandLineParser parser = new DefaultParser();
      CommandLine cmd = null;
      try {
        cmd = parser.parse(options, _args, true);
      } catch (ParseException e) {
        throw new CommandLineParserException(e.getMessage());
      }
  
      HashMap<String, Object> mapOptionValues = new HashMap<>();
      Collection<Option> optionCollection = options.getOptions();
      for (Option option : optionCollection) {
        if (option.hasArg()) {
          mapOptionValues.put(option.getOpt(), cmd.getOptionValue(option.getOpt()));
        } else {
          if (cmd.hasOption(option.getOpt()) || cmd.hasOption(option.getLongOpt())) {
            mapOptionValues.put(option.getOpt(), true);
          } else {
            mapOptionValues.put(option.getOpt(), false);
          }
        }
      }
  
      return mapOptionValues;
    }
focal_method.class_method_signature: CommandParser.parse(String[] _args, Options options)
focal_method.full_signature: public static HashMap<String, Object> parse(String[] _args, Options options)
focal_method.identifier: parse
focal_method.invocations: parse getMessage getOptions hasArg put getOpt getOptionValue getOpt hasOption getOpt hasOption getLongOpt put getOpt put getOpt
focal_method.modifiers: public static
focal_method.parameters: (String[] _args, Options options)
focal_method.return: HashMap<String, Object>
focal_method.signature: HashMap<String, Object> parse(String[] _args, Options options)