def validate(dic, option_list):
	for key in dic.viewkeys():
		if key in option_list:
			for option in option_list:
				if option != key:
					if dic[option] and dic[key]:
						raise click.UsageError('Invalid option combination --%s \
							cannot be used with --%s' % (option, key))

	if (dic['restore'] and not dic['backup_id']) \
		or (dic['backup_id'] and not dic['restore']):
		raise click.UsageError('--restore option requires --backup-id')

	if (dic['resize'] and not dic['size']) or (dic['size'] and not dic['resize']):
		raise click.UsageError('--resize option requires --size')

	if (dic['rebuild'] and not dic['image']) or (dic['image'] and not dic['rebuild']):
		raise click.UsageError('--rebuild option requires --image')

	if (dic['rename'] and not dic['name']) or (dic['name'] and not dic['rename']):
		raise click.UsageError('--rename option requires --name')

	if (dic['change_kernel'] and not dic['kernel']) \
		or (dic['kernel'] and not dic['change_kernel']):
		raise click.UsageError('--change-kernel option requires --kernel')

	if (dic['snapshot'] and not dic['sname']) \
		or (dic['sname'] and not dic['snapshot']):
		raise click.UsageError('--snapshot option requires --sname')

	return True
droplet actions command validation
dataset/ETHPy150Open yspanchal/docli/docli/commands/droplet_actions.py/validate