CLI: autocomplete fixes

   * Add a pattern cache to make autocomplete faster
   * Implement complete for enum attribute values