I think that is how I would have written Rangers animal companions.
action to attack ... it keeps attacking and attacks anything that attacks it (defends itself)
If you want it to attack an new target then you use another action to command it.
I would have wanted them to give the Ranger to use animals as companions with a limit on how powerful of an animal to use. Best to treat the animals as hirelings. The way they have it now is odd.