How to call an attack animation that will stop when you stop clicking attack button?

We are creating a 2D side-scrolling game using c#. We have a script to call our attack animation when you click ‘A’. However we can’t figure out how to call the idle/run animation once were done attacking (‘A’ is released). Right now, once you click ‘A’ once during game play the attack animation won’t stop. I think we need to call the idle/run animation in the empty else statement but not sure how. Here is our script:

public class PlayerAttack : MonoBehaviour {
public GameObject target;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
	if(Input.GetKeyUp(KeyCode.A)) 
	{
		Attack();
	} 
	else
	{

	}
}

private void Attack()
{
	GetComponent<Animator>().SetBool("Attacking", true);

	float distance = Vector3.Distance (target.transform.position, transform.position);

	if(distance < 2.5)
	{
		Enemyhealth eh = (Enemyhealth)target.GetComponent("Enemyhealth");
		eh.ChangeHealth(-10);
	}

}

}

void Update(){
//** OPTION A **
if(Input.GetKeyDown(KeyCode.A)){
attacking = true;
//play attack
}
if(Input.GetKeyUp(KeyCode.A) && attacking){
attacking = false;
//play idle
}

		//** OPTION B **
		//As long as you hold the button down, attacking will be true.
		//Keep in mind this will trigger the attacking = true every update cycle
		if(Input.GetKey(KeyCode.A)){  
			attacking = true;
			//play attack
		}else{
			if(attacking){
				attacking = false;
				//play idle
			}
		}
	}