kwargs['help'] = help + (
    ' NOTE: This argument is mutually exclusive with  arguments: [' +
    ex_str + '].')
super(MutuallyExclusiveOption, self).__init__(*args, **kwargs)

def handle_parse_result(self, ctx, opts, args):
    if self.mutually_exclusive.intersection(opts) and self.name in opts:
        raise UsageError(
            'Illegal usage: `{}` is mutually exclusive with arguments `{}`.'
            .format(self.name, ', '.join(self.mutually_exclusive)))
return super(MutuallyExclusiveOption, self).handle_parse_result(ctx, opts, args
    )
Mutually exclusive option groups in python Click