

def cli_help(context, command_name, general_parser, command_parsers):
    '\n    Outputs help information.\n\n    See :py:mod:`swiftly.cli.help` for context usage information.\n\n    See :py:class:`CLIHelp` for more information.\n\n    :param context: The :py:class:`swiftly.cli.context.CLIContext` to\n        use.\n    :param command_name: The command_name to output help information\n        for, or set to None or an empty string to output the general\n        help information.\n    :param general_parser: The\n        :py:class:`swiftly.cli.optionparser.OptionParser` for general\n        usage.\n    :param command_parsers: A dict of (name, :py:class:`CLICommand`)\n        for specific command usage.\n    '
    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))

dataset/ETHPy150Open gholt/swiftly/swiftly/cli/help.py cli_help/original