completion: avoid unnecessary `brew` invocations