import re


def escape_description(desc):
    """ Escape a string for use as an argument description.

    :param str desc: the description
    :returns: esacped description
    :rtype: str
    """
    desc = desc.replace('\n', ' ')
    desc = desc.replace('\'', '')

    # Special meaning in zsh optspec, so substitute inoffensive braces.
    desc = desc.replace('[', '{')
    desc = desc.replace(']', '}')
    desc = re.sub(' +', ' ', desc)

    # Descriptions are way too long.  Kill everything after the first sentence.
    desc = re.sub('\.\s.*$', '', desc)

    return desc