The "Name" section of the help string.
(component, info, trace=None, verbose=False)
| 95 | |
| 96 | |
| 97 | def _NameSection(component, info, trace=None, verbose=False) -> tuple[str, str]: |
| 98 | """The "Name" section of the help string.""" |
| 99 | |
| 100 | # Only include separators in the name in verbose mode. |
| 101 | current_command = _GetCurrentCommand(trace, include_separators=verbose) |
| 102 | summary = _GetSummary(info) |
| 103 | |
| 104 | # If the docstring is one of the messy builtin docstrings, show custom one. |
| 105 | if custom_descriptions.NeedsCustomDescription(component): |
| 106 | available_space = LINE_LENGTH - SECTION_INDENTATION - len(current_command + |
| 107 | ' - ') |
| 108 | summary = custom_descriptions.GetSummary(component, available_space, |
| 109 | LINE_LENGTH) |
| 110 | |
| 111 | if summary: |
| 112 | text = f'{current_command} - {summary}' |
| 113 | else: |
| 114 | text = current_command |
| 115 | return ('NAME', text) |
| 116 | |
| 117 | |
| 118 | def _SynopsisSection(component, actions_grouped_by_kind, spec, metadata, |
no test coverage detected