From 91e551a2836b47dc0c44039006b684f0e6a2bc7e Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 18 Jul 2017 10:01:45 +0100 Subject: [PATCH] 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 --- cliff/sphinxext.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cliff/sphinxext.py b/cliff/sphinxext.py index 16915fac..793def88 100644 --- a/cliff/sphinxext.py +++ b/cliff/sphinxext.py @@ -221,12 +221,10 @@ class AutoprogramCliffDirective(rst.Directive): ignored_opts): """Generate the relevant Sphinx nodes. - This is a little funky. Parts of this use raw docutils nodes while - other parts use reStructuredText and nested parsing. The reason for - this is simple: it avoids us having to reinvent the wheel. While raw - docutils nodes are helpful for the simpler elements of the output, - they don't provide an easy way to use Sphinx's own directives, such as - the 'option' directive. Refer to [1] for more information. + This doesn't bother using raw docutils nodes as they simply don't offer + the power of directives, like Sphinx's 'option' directive. Instead, we + generate reStructuredText and parse this in a nested context (to obtain + correct header levels). Refer to [1] for more information. [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) ignored_opts = ignored_opts or [] - # Drop the automatically-added help action + # Drop any ignored actions for action in list(parser._actions): for option_string in action.option_strings: if option_string in ignored_opts: