Skip to content

Commit c7bd4ce

Browse files
committed
docs: Format CLI reference code block
1 parent 5d459e6 commit c7bd4ce

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

docs/cli_reference.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,15 @@ from griffe.cli import get_parser
99
parser = get_parser()
1010

1111

12-
def render_parser(
13-
parser: argparse.ArgumentParser, title: str, heading_level: int = 2
14-
) -> str:
12+
def render_parser(parser: argparse.ArgumentParser, title: str, heading_level: int = 2) -> str:
1513
"""Render the parser help documents as a string."""
1614
result = [f"{'#' * heading_level} {title}\n"]
1715
if parser.description and title != "pdm":
1816
result.append("> " + parser.description + "\n")
1917

20-
for group in sorted(
21-
parser._action_groups, key=lambda g: g.title.lower(), reverse=True
22-
):
18+
for group in sorted(parser._action_groups, key=lambda g: g.title.lower(), reverse=True):
2319
if not any(
24-
bool(action.option_strings or action.dest)
25-
or isinstance(action, argparse._SubParsersAction)
20+
bool(action.option_strings or action.dest) or isinstance(action, argparse._SubParsersAction)
2621
for action in group._group_actions
2722
):
2823
continue

0 commit comments

Comments
 (0)