

def excludeStr(self, longname, buildShort=False):
    '\n        Generate an "exclusion string" for the given option\n\n        @type longname: C{str}\n        @param longname: The long option name (e.g. "verbose" instead of "v")\n\n        @type buildShort: C{bool}\n        @param buildShort: May be True to indicate we\'re building an excludes\n            string for the short option that correspondes to the given long opt.\n\n        @return: The generated C{str}\n        '
    if (longname in self.excludes):
        exclusions = self.excludes[longname].copy()
    else:
        exclusions = set()
    if (longname not in self.multiUse):
        if (buildShort is False):
            short = self.getShortOption(longname)
            if (short is not None):
                exclusions.add(short)
        else:
            exclusions.add(longname)
    if (not exclusions):
        return ''
    strings = []
    for optName in exclusions:
        if (len(optName) == 1):
            strings.append(('-' + optName))
        else:
            strings.append(('--' + optName))
    strings.sort()
    return ('(%s)' % ' '.join(strings))

dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/python/_shellcomp.py ZshArgumentsGenerator.excludeStr/original