Writes the help text to the formatter if it exists.
(self, ctx: click.Context, formatter: click.HelpFormatter)
| 126 | self.format_epilog(ctx, formatter) |
| 127 | |
| 128 | def format_help_text(self, ctx: click.Context, formatter: click.HelpFormatter) -> None: |
| 129 | """Writes the help text to the formatter if it exists.""" |
| 130 | if self.help: |
| 131 | base_command = ctx.parent.info_name if ctx.parent is not None else ctx.info_name |
| 132 | formatted_help = self.help.format( |
| 133 | scenedetect=base_command, scenedetect_with_video=f"{base_command} -i video.mp4" |
| 134 | ) |
| 135 | text = inspect.cleandoc(formatted_help).partition("\f")[0] |
| 136 | formatter.write_paragraph() |
| 137 | formatter.write_text(text) |
| 138 | |
| 139 | def format_epilog(self, ctx: click.Context, formatter: click.HelpFormatter) -> None: |
| 140 | """Writes the epilog into the formatter if it exists.""" |