def METHOD_NAME(self, state, args):
    name = identifier(args.plugin)
    rst_output = None
    if name == caseless_string('settings'):
        rst_output = get_rst_for_global_config()
        rst_output += get_rst_for_envars()
        plugin_name = name.lower()
        kind = 'global:'
    else:
        try:
            plugin = pluginloader.get_plugin_class(name)
        except NotFoundError:
            plugin = None
        if plugin:
            rst_output = get_rst_from_plugin(plugin)
            plugin_name = plugin.name
            kind = '{}:'.format(plugin.kind)
        else:
            target = get_target_description(name)
            if target:
                rst_output = get_rst_from_target(target)
                plugin_name = target.name
                kind = 'target:'
    if not rst_output:
        raise NotFoundError('Could not find plugin or alias "{}"'.format(name))
    if which('pandoc'):
        p = Popen(['pandoc', '-f', 'rst', '-t', 'man'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
        if sys.version_info[0] == 3:
            output, _ = p.communicate(rst_output.encode(sys.stdin.encoding))
            output = output.decode(sys.stdout.encoding)
        else:
            output, _ = p.communicate(rst_output)
        # Make sure to double escape back slashes
        output = output.replace('\\', '\\\\\\')
        # Correctly format the title and page number of the man page
        title, body = output.split('\n', 1)
        title = '.TH {}{} 7'.format(kind, plugin_name)
        output = '\n'.join([title, body])
        call('echo "{}" | man -l -'.format(escape_double_quotes(output)), shell=True)
    else:
        print(rst_output)  # pylint: disable=superfluous-parens