This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from click import command, option, Option, UsageError | |
class MutuallyExclusiveOption(Option): | |
def __init__(self, *args, **kwargs): | |
self.mutually_exclusive = set(kwargs.pop('mutually_exclusive', [])) | |
help = kwargs.get('help', '') | |
if self.mutually_exclusive: | |
ex_str = ', '.join(self.mutually_exclusive) | |
kwargs['help'] = help + ( | |
' NOTE: This argument is mutually exclusive with ' |