Writes the help text to the formatter if it exists.
(self, ctx: Context, formatter: HelpFormatter)
| 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.""" |
no test coverage detected