trivial: Fix comments in sphinxext module
Comments shouldn't lie and these ones weren't updated to reflect recent changes in the feature. Correct this here. Change-Id: I56e9a49f15948a0f056c5bb3fb57bee0c3a9bcc6
This commit is contained in:
parent
772e16d6bb
commit
91e551a283
|
@ -221,12 +221,10 @@ class AutoprogramCliffDirective(rst.Directive):
|
||||||
ignored_opts):
|
ignored_opts):
|
||||||
"""Generate the relevant Sphinx nodes.
|
"""Generate the relevant Sphinx nodes.
|
||||||
|
|
||||||
This is a little funky. Parts of this use raw docutils nodes while
|
This doesn't bother using raw docutils nodes as they simply don't offer
|
||||||
other parts use reStructuredText and nested parsing. The reason for
|
the power of directives, like Sphinx's 'option' directive. Instead, we
|
||||||
this is simple: it avoids us having to reinvent the wheel. While raw
|
generate reStructuredText and parse this in a nested context (to obtain
|
||||||
docutils nodes are helpful for the simpler elements of the output,
|
correct header levels). Refer to [1] for more information.
|
||||||
they don't provide an easy way to use Sphinx's own directives, such as
|
|
||||||
the 'option' directive. Refer to [1] for more information.
|
|
||||||
|
|
||||||
[1] http://www.sphinx-doc.org/en/stable/extdev/markupapi.html
|
[1] http://www.sphinx-doc.org/en/stable/extdev/markupapi.html
|
||||||
|
|
||||||
|
@ -241,7 +239,7 @@ class AutoprogramCliffDirective(rst.Directive):
|
||||||
parser = command.get_parser(command_name)
|
parser = command.get_parser(command_name)
|
||||||
ignored_opts = ignored_opts or []
|
ignored_opts = ignored_opts or []
|
||||||
|
|
||||||
# Drop the automatically-added help action
|
# Drop any ignored actions
|
||||||
for action in list(parser._actions):
|
for action in list(parser._actions):
|
||||||
for option_string in action.option_strings:
|
for option_string in action.option_strings:
|
||||||
if option_string in ignored_opts:
|
if option_string in ignored_opts:
|
||||||
|
|
Loading…
Reference in New Issue