# 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
        """Handle positional and optional actions with help messages."""
        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')

        output = '\n'.join(sphinxext._format_parser(parser))
        self.assertEqual(textwrap.dedent("""
        .. program:: hello-world
        .. code-block:: shell

            hello-world [--language LANG] name

        .. option:: --language <LANG>

            greeting language

        .. option:: name

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

    def test_description_epilog(self):
        """Handle a parser description, epilog."""
        parser = argparse.ArgumentParser(prog='hello-world', add_help=False,
                                         description='A "Hello, World" app.',
                                         epilog='What am I doing down here?')
        parser.add_argument('name', action='store')
        parser.add_argument('--language', dest='lang')


# 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

        """Handle positional and optional actions with help messages."""
        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')

        output = '\n'.join(sphinxext._format_parser(parser))
        self.assertEqual(textwrap.dedent("""
        .. program:: hello-world
        .. code-block:: shell

            hello-world [--language LANG] name

        .. option:: --language <LANG>

            greeting language

        .. option:: name

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

    def test_description_epilog(self):
        """Handle a parser description, epilog."""
        parser = argparse.ArgumentParser(prog='hello-world', add_help=False,
                                         description='A "Hello, World" app.',
                                         epilog='What am I doing down here?')
        parser.add_argument('name', action='store')
        parser.add_argument('--language', dest='lang')


        output = '\n'.join(sphinxext._format_parser(parser))