MCPcopy
hub / github.com/pallets/click / format_help_text

Method format_help_text

src/click/core.py:1227–1243  ·  view source on GitHub ↗

Writes the help text to the formatter if it exists.

(self, ctx: Context, formatter: HelpFormatter)

Source from the content-addressed store, hash-verified

1225 self.format_epilog(ctx, formatter)
1226
1227 def format_help_text(self, ctx: Context, formatter: HelpFormatter) -> None:
1228 """Writes the help text to the formatter if it exists."""
1229 if self.help is not None:
1230 # truncate the help text to the first form feed
1231 text = inspect.cleandoc(self.help).partition("\f")[0]
1232 else:
1233 text = ""
1234
1235 if self.deprecated:
1236 label = _format_deprecated_label(self.deprecated)
1237 text = f"{_(text)} {label}" if text else label
1238
1239 if text:
1240 formatter.write_paragraph()
1241
1242 with formatter.indentation():
1243 formatter.write_text(text)
1244
1245 def format_options(self, ctx: Context, formatter: HelpFormatter) -> None:
1246 """Writes all the options into the formatter if they exist."""

Callers 1

format_helpMethod · 0.95

Calls 4

_format_deprecated_labelFunction · 0.85
write_paragraphMethod · 0.80
indentationMethod · 0.80
write_textMethod · 0.80

Tested by

no test coverage detected