MCPcopy Index your code
hub / github.com/idank/explainshell / _option_detail_lines

Function _option_detail_lines

explainshell/diff.py:172–185  ·  view source on GitHub ↗
(opt: object, prefix: str = "", color: str = "")

Source from the content-addressed store, hash-verified

170
171
172def _option_detail_lines(opt: object, prefix: str = "", color: str = "") -> list[str]:
173 lines: list[str] = []
174 lines.append(f"{color}{prefix} short: {opt.short}") # type: ignore[union-attr]
175 lines.append(f"{prefix} long: {opt.long}") # type: ignore[union-attr]
176 lines.append(f"{prefix} has_argument: {opt.has_argument}") # type: ignore[union-attr]
177 if opt.positional: # type: ignore[union-attr]
178 lines.append(f"{prefix} positional: {opt.positional}") # type: ignore[union-attr]
179 if opt.nested_cmd: # type: ignore[union-attr]
180 lines.append(f"{prefix} nested_cmd: {opt.nested_cmd}") # type: ignore[union-attr]
181 desc = opt.text.strip() # type: ignore[union-attr]
182 for line in desc.split("\n"):
183 lines.append(f"{prefix} {line}")
184 lines.append(_RESET)
185 return lines
186
187
188def format_diff(stored_mp: ParsedManpage, fresh_mp: ParsedManpage) -> list[str]:

Callers 1

format_diffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected