MCPcopy
hub / github.com/scrapy/scrapy / _run_print_help

Function _run_print_help

scrapy/cmdline.py:153–166  ·  view source on GitHub ↗
(
    parser: argparse.ArgumentParser,
    func: Callable[_P, None],
    *a: _P.args,
    **kw: _P.kwargs,
)

Source from the content-addressed store, hash-verified

151
152
153def _run_print_help(
154 parser: argparse.ArgumentParser,
155 func: Callable[_P, None],
156 *a: _P.args,
157 **kw: _P.kwargs,
158) -> None:
159 try:
160 func(*a, **kw)
161 except UsageError as e:
162 if str(e):
163 parser.error(str(e))
164 if e.print_help:
165 parser.print_help()
166 sys.exit(2)
167
168
169def execute(argv: list[str] | None = None, settings: Settings | None = None) -> None:

Callers 1

executeFunction · 0.85

Calls 2

errorMethod · 0.80
print_helpMethod · 0.80

Tested by

no test coverage detected