def validate(dic, option_list):
	"""
	ssh key command validation
	"""
	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['create'] and not dic['name'] and not dic['key'])\
	or (dic['name'] and not dic['create'] and not dic['key'])\
	or (dic['key'] and not dic['create'] and not dic['name']):
		raise click.UsageError('Missing option, --create requires --name and \
			--key option')

	if (dic['update'] and not dic['name'] or not dic['key']):
		raise click.UsageError('Missing option, --update requires --name or \
			--key option')

	return True
dataset/ETHPy150Open yspanchal/docli/docli/commands/ssh_keys.py/validate/original