swiftly/cli/help.py
def cli_help(context, command_name, general_parser, command_parsers):
    """
    Outputs help information.

    See :py:mod:`swiftly.cli.help` for context usage information.

    See :py:class:`CLIHelp` for more information.

    :param context: The :py:class:`swiftly.cli.context.CLIContext` to
        use.
    :param command_name: The command_name to output help information
        for, or set to None or an empty string to output the general
        help information.
    :param general_parser: The
        :py:class:`swiftly.cli.optionparser.OptionParser` for general
        usage.
    :param command_parsers: A dict of (name, :py:class:`CLICommand`)
        for specific command usage.
    """
    if command_name == 'for':
        command_name = 'fordo'
    with context.io_manager.with_stdout() as stdout:
        if not command_name:
            general_parser.print_help(stdout)
        elif command_name in command_parsers:
            command_parsers[command_name].option_parser.print_help(stdout)
        else:
            raise ReturnCode('unknown command %r' % command_name)
def cli_help(context, command_name, general_parser, command_parsers):
    if command_name == 'for':
        command_name = 'fordo'
    with context.io_manager.with_stdout() as stdout:
        if not command_name:
            general_parser.print_help(stdout)
        elif command_name in command_parsers:
            command_parsers[command_name].option_parser.print_help(stdout)
        else:
            raise ReturnCode('unknown command %r' % command_name)
def cli_help ( context , command_name , general_parser , command_parsers ) : if command_name == 'for' : command_name = 'fordo' with context . io_manager . with_stdout ( ) as stdout : if not command_name : general_parser . print_help ( stdout ) elif command_name in command_parsers : command_parsers [ command_name ] . option_parser . print_help ( stdout ) else : raise ReturnCode ( 'unknown command %r' % command_name )
Outputs help information.

    See :py:mod:`swiftly.cli.help` for context usage information.

    See :py:class:`CLIHelp` for more information.

    :param context: The :py:class:`swiftly.cli.context.CLIContext` to
        use.
    :param command_name: The command_name to output help information
        for, or set to None or an empty string to output the general
        help information.
    :param general_parser: The
        :py:class:`swiftly.cli.optionparser.OptionParser` for general
        usage.
    :param command_parsers: A dict of (name, :py:class:`CLICommand`)
        for specific command usage.
Outputs help information .