Marco Ricci commited on 2024-06-30 16:37:52
Zeige 1 geänderte Dateien mit 15 Einfügungen und 8 Löschungen.
... | ... |
@@ -338,14 +338,17 @@ class CommandWithHelpGroups(click.Command): |
338 | 338 |
) -> None: |
339 | 339 |
r"""Format options on the help listing, grouped into sections. |
340 | 340 |
|
341 |
- As part of the `--help` listing, list all options, but grouped |
|
342 |
- into sections according to the concrete [`click.Option`][] |
|
343 |
- subclass being used. If the option is an instance of some |
|
344 |
- subclass `X` of [`derivepassphrase.cli.OptionGroupOption`][], |
|
345 |
- then the section heading and the epilog is taken from |
|
346 |
- `X.option_group_name` and `X.epilog`; otherwise, the section |
|
347 |
- heading is "Options" (or "Other options" if there are other |
|
348 |
- option groups) and the epilog is empty. |
|
341 |
+ This is a callback for [`click.Command.get_help`][] that |
|
342 |
+ implements the `--help` listing, by calling appropriate methods |
|
343 |
+ of the `formatter`. We list all options (like the base |
|
344 |
+ implementation), but grouped into sections according to the |
|
345 |
+ concrete [`click.Option`][] subclass being used. If the option |
|
346 |
+ is an instance of some subclass `X` of |
|
347 |
+ [`derivepassphrase.cli.OptionGroupOption`][], then the section |
|
348 |
+ heading and the epilog are taken from `X.option_group_name` and |
|
349 |
+ `X.epilog`; otherwise, the section heading is "Options" (or |
|
350 |
+ "Other options" if there are other option groups) and the epilog |
|
351 |
+ is empty. |
|
349 | 352 |
|
350 | 353 |
Args: |
351 | 354 |
ctx: |
... | ... |
@@ -353,6 +356,10 @@ class CommandWithHelpGroups(click.Command): |
353 | 356 |
formatter: |
354 | 357 |
The formatter for the `--help` listing. |
355 | 358 |
|
359 |
+ Returns: |
|
360 |
+ Nothing. Output is generated by calling appropriate methods |
|
361 |
+ on `formatter` instead. |
|
362 |
+ |
|
356 | 363 |
""" |
357 | 364 |
help_records: dict[str, list[tuple[str, str]]] = {} |
358 | 365 |
epilogs: dict[str, str] = {} |
359 | 366 |