MCPcopy Create free account
hub / github.com/CiscoPSIRT/openVulnQuery / parser_factory

Function parser_factory

openVulnQuery/_library/cli_api.py:331–353  ·  view source on GitHub ↗

Knit CLI API together and produce an argparse based parser.

()

Source from the content-addressed store, hash-verified

329
330
331def parser_factory():
332 """Knit CLI API together and produce an argparse based parser."""
333 p = argparse.ArgumentParser(
334 prog='openVulnQuery',
335 description='Cisco OpenVuln API Command Line Interface')
336 p.set_defaults(output_format=(constants.JSON_OUTPUT_FORMAT_TOKEN, None))
337
338
339 add_options_to_parser(
340 p.add_mutually_exclusive_group(required=True), CLI_API_API_RESOURCE)
341
342 add_options_to_parser(
343 p.add_mutually_exclusive_group(), CLI_API_OUTPUT_FORMAT)
344
345 add_options_to_parser(
346 p.add_mutually_exclusive_group(), CLI_API_ADDITIONAL_FILTERS)
347
348 add_options_to_parser(p, CLI_API_PARSER_GENERIC)
349
350 add_options_to_parser(
351 p.add_mutually_exclusive_group(required=False), CLI_API_CONFIG)
352
353 return p
354
355
356def process_command_line(string_list=None):

Callers 1

process_command_lineFunction · 0.85

Calls 1

add_options_to_parserFunction · 0.85

Tested by

no test coverage detected