test_class.file: rawhttp-cli/src/test/java/rawhttp/cli/OptionsParserTest.java
test_class.identifier: OptionsParserTest
test_case.body: @Test
      public void cannotParseServeRootPathOptionMissingMandatoryArg() {
          try {
              OptionsParser.parse(new String[]{"run"});
              fail("Should not be able to parse run command without options");
          } catch (OptionsException e) {
              assertEquals("No http requests file provided", e.getMessage());
          }
      }
test_case.class_method_signature: OptionsParserTest.cannotParseServeRootPathOptionMissingMandatoryArg()
test_case.full_signature: @Test public void cannotParseServeRootPathOptionMissingMandatoryArg()
test_case.identifier: cannotParseServeRootPathOptionMissingMandatoryArg
test_case.invocations: parse fail assertEquals getMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void cannotParseServeRootPathOptionMissingMandatoryArg()
focal_class.declarator: AVAILABLE_COMMANDS_MSG =
              "Available commands are 'send', 'run', 'serve' and 'help'.\n" +
                      "Use the 'help' command to show more information."
focal_class.modifier: private static final
focal_class.original_string: private static final String AVAILABLE_COMMANDS_MSG =
              "Available commands are 'send', 'run', 'serve' and 'help'.\n" +
                      "Use the 'help' command to show more information.";
focal_class.type: String
focal_class.var_name: AVAILABLE_COMMANDS_MSG
focal_class.file: rawhttp-cli/src/main/java/rawhttp/cli/OptionsParser.java
focal_class.identifier: OptionsParser
focal_class.class_method_signature: OptionsParser.parse(String[] args)
focal_class.full_signature: static Options parse(String[] args)
focal_class.identifier: parse
focal_class.modifiers: static
focal_class.parameters: (String[] args)
focal_class.return: Options
focal_class.signature: Options parse(String[] args)
focal_class.class_method_signature: OptionsParser.parseSendCommand(String[] args)
focal_class.full_signature: private static Options parseSendCommand(String[] args)
focal_class.identifier: parseSendCommand
focal_class.modifiers: private static
focal_class.parameters: (String[] args)
focal_class.return: Options
focal_class.signature: Options parseSendCommand(String[] args)
focal_class.class_method_signature: OptionsParser.parseRunCommand(String[] args)
focal_class.full_signature: private static Options parseRunCommand(String[] args)
focal_class.identifier: parseRunCommand
focal_class.modifiers: private static
focal_class.parameters: (String[] args)
focal_class.return: Options
focal_class.signature: Options parseRunCommand(String[] args)
focal_class.class_method_signature: OptionsParser.parseServeCommand(String[] args)
focal_class.full_signature: private static Options parseServeCommand(String[] args)
focal_class.identifier: parseServeCommand
focal_class.modifiers: private static
focal_class.parameters: (String[] args)
focal_class.return: Options
focal_class.signature: Options parseServeCommand(String[] args)
focal_method.body: static Options parse(String[] args) throws OptionsException {
          if (args.length == 0) {
              throw new OptionsException("No sub-command provided. " + AVAILABLE_COMMANDS_MSG);
          }
          String subCommand = args[0];
          switch (subCommand) {
              case "send":
                  return parseSendCommand(args);
              case "run":
                  return parseRunCommand(args);
              case "serve":
                  return parseServeCommand(args);
              case "help":
              case "-h":
                  HelpOptions helpOptions = HelpOptions.GENERAL;
                  if (args.length > 1) try {
                      helpOptions = HelpOptions.valueOf(args[1].toUpperCase());
                  } catch (IllegalArgumentException e) {
                      // ignore invalid option
                  }
                  return Options.justShowHelp(helpOptions);
              default:
                  throw new OptionsException("Unknown sub-command: " + subCommand + ". " +
                          AVAILABLE_COMMANDS_MSG);
          }
      }
focal_method.class_method_signature: OptionsParser.parse(String[] args)
focal_method.full_signature: static Options parse(String[] args)
focal_method.identifier: parse
focal_method.invocations: parseSendCommand parseRunCommand parseServeCommand valueOf toUpperCase justShowHelp
focal_method.modifiers: static
focal_method.parameters: (String[] args)
focal_method.return: Options
focal_method.signature: Options parse(String[] args)