File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,20 +9,15 @@ from griffe.cli import get_parser
99parser = 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
You can’t perform that action at this time.
0 commit comments