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

Method format_options

src/click/core.py:1245–1255  ·  view source on GitHub ↗

Writes all the options into the formatter if they exist.

(self, ctx: Context, formatter: HelpFormatter)

Source from the content-addressed store, hash-verified

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."""
1247 opts = []
1248 for param in self.get_params(ctx):
1249 rv = param.get_help_record(ctx)
1250 if rv is not None:
1251 opts.append(rv)
1252
1253 if opts:
1254 with formatter.section(_("Options")):
1255 formatter.write_dl(opts)
1256
1257 def format_epilog(self, ctx: Context, formatter: HelpFormatter) -> None:
1258 """Writes the epilog into the formatter if it exists."""

Callers 1

format_helpMethod · 0.95

Calls 4

get_paramsMethod · 0.95
sectionMethod · 0.80
write_dlMethod · 0.80
get_help_recordMethod · 0.45

Tested by

no test coverage detected