def build_parser(line):<EOL>
parser = optparse.OptionParser(add_help_option=False)<EOL>option_factories = SUPPORTED_OPTIONS + SUPPORTED_OPTIONS_REQ<EOL>for option_factory in option_factories:<EOL><INDENT>option = option_factory()<EOL>parser.add_option(option)<EOL><DEDENT>def parser_exit(self, msg):<EOL><INDENT>msg = '<STR_LIT>' % (line, msg)<EOL>raise RequirementsFileParseError(msg)<EOL><DEDENT>parser.exit = parser_exit  <EOL>return parser<EOL>
Return a parser for parsing requirement lines