# Path: cliff/sphinxext.py
# def _indent(text):
#     def prefixed_lines():
# def _format_description(parser):
# def _format_usage(parser):
# def _format_epilog(parser):
# def _format_positional_action(action):
# def _format_optional_action(action):
# def _format_parser(parser):
#     def _get_ignored_opts(self):
#     def _drop_ignored_options(self, parser, ignored_opts):
#     def _load_app(self):
#     def _load_command(self, manager, command_name):
#     def _load_commands(self):
#     def _generate_app_node(self, app, application_name):
#     def _generate_nodes_per_command(self, title, command_name, command_class,
#                                     ignored_opts):
#     def _generate_command_nodes(self, commands, application_name):
#     def run(self):
# def setup(app):
# class AutoprogramCliffDirective(rst.Directive):


import argparse
import textwrap
from cliff import sphinxext
from cliff.tests import base
        .. code-block:: shell

            hello-world <NAME> [<NAME> ...]

        .. option:: NAME

            a user name
        """).lstrip(), output)

    def test_multiple_opts(self):
        """Correctly output multiple opts on separate lines."""
        parser = argparse.ArgumentParser(prog='hello-world', add_help=False)
        parser.add_argument('name', help='user name')
        parser.add_argument('--language', dest='lang',
                            help='greeting language')
        parser.add_argument('--translate', action='store_true',
                            help='translate to local language')
        parser.add_argument('--write-to-var-log-something-or-other',
                            action='store_true',
                            help='a long opt to force wrapping')
        parser.add_argument('--required-arg', dest='stuff', required=True,
                            help='a required argument')
        style_group = parser.add_mutually_exclusive_group(required=True)
        style_group.add_argument('--polite', action='store_true',
                                 help='use a polite greeting')
        style_group.add_argument('--profane', action='store_true',
                                 help='use a less polite greeting')

        output = '\n'.join(sphinxext._format_parser(parser))
        self.assertEqual(textwrap.dedent("""

# Path: cliff/sphinxext.py
# def _indent(text):
#     def prefixed_lines():
# def _format_description(parser):
# def _format_usage(parser):
# def _format_epilog(parser):
# def _format_positional_action(action):
# def _format_optional_action(action):
# def _format_parser(parser):
#     def _get_ignored_opts(self):
#     def _drop_ignored_options(self, parser, ignored_opts):
#     def _load_app(self):
#     def _load_command(self, manager, command_name):
#     def _load_commands(self):
#     def _generate_app_node(self, app, application_name):
#     def _generate_nodes_per_command(self, title, command_name, command_class,
#                                     ignored_opts):
#     def _generate_command_nodes(self, commands, application_name):
#     def run(self):
# def setup(app):
# class AutoprogramCliffDirective(rst.Directive):


# Path: cliff/tests/test_sphinxext.py
import argparse
import textwrap
from cliff import sphinxext
from cliff.tests import base

        .. code-block:: shell

            hello-world <NAME> [<NAME> ...]

        .. option:: NAME

            a user name
        """).lstrip(), output)

    def test_multiple_opts(self):
        """Correctly output multiple opts on separate lines."""
        parser = argparse.ArgumentParser(prog='hello-world', add_help=False)
        parser.add_argument('name', help='user name')
        parser.add_argument('--language', dest='lang',
                            help='greeting language')
        parser.add_argument('--translate', action='store_true',
                            help='translate to local language')
        parser.add_argument('--write-to-var-log-something-or-other',
                            action='store_true',
                            help='a long opt to force wrapping')
        parser.add_argument('--required-arg', dest='stuff', required=True,
                            help='a required argument')
        style_group = parser.add_mutually_exclusive_group(required=True)
        style_group.add_argument('--polite', action='store_true',
                                 help='use a polite greeting')
        style_group.add_argument('--profane', action='store_true',
                                 help='use a less polite greeting')

        output = '\n'.join(sphinxext._format_parser(parser))
        self.assertEqual(textwrap.dedent("""

        .. program:: hello-world