Skip to content

Commit d9d64f6

Browse files
committed
Add the document settings to print_subcommands
This commit follows alex-rudakov/sphinx-argparse#61 and gives the document settings to the print_subcommands function
1 parent 78379dd commit d9d64f6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sphinxarg/ext.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def print_action_groups(data, nested_content, markDownHelp=False, settings=None)
150150
return nodes_list
151151

152152

153-
def print_subcommands(data, nested_content, markDownHelp=False):
153+
def print_subcommands(data, nested_content, markDownHelp=False, settings=None):
154154
"""
155155
Each subcommand is a dictionary with the following keys:
156156
@@ -191,10 +191,12 @@ def print_subcommands(data, nested_content, markDownHelp=False):
191191
for element in renderList(desc, markDownHelp):
192192
sec += element
193193
sec += nodes.literal_block(text=child['bare_usage'])
194-
for x in print_action_groups(child, nested_content + subContent, markDownHelp):
194+
for x in print_action_groups(child, nested_content + subContent, markDownHelp,
195+
settings=settings):
195196
sec += x
196197

197-
for x in print_subcommands(child, nested_content + subContent, markDownHelp):
198+
for x in print_subcommands(child, nested_content + subContent, markDownHelp,
199+
settings=settings):
198200
sec += x
199201

200202
subCommands += sec
@@ -479,7 +481,8 @@ def run(self):
479481
items.extend(print_action_groups(result, nested_content, markDownHelp,
480482
settings=self.state.document.settings))
481483
if 'nosubcommands' not in self.options:
482-
items.extend(print_subcommands(result, nested_content, markDownHelp))
484+
items.extend(print_subcommands(result, nested_content, markDownHelp,
485+
settings=self.state.document.settings))
483486
if 'epilog' in result and 'noepilog' not in self.options:
484487
items.append(self._nested_parse_paragraph(result['epilog']))
485488

0 commit comments

Comments
 (0)