Add support for aliases in ov
#4407
Labels
🤖 aspect: dx
Concerns developers' experience with the codebase
🧰 goal: internal improvement
Improvement that benefits maintainers, not users
🟩 priority: low
Low priority and doesn't need to be rushed
🧱 stack: mgmt
Related to repo management and automations
Problem
We tried adding aliases in #4343 using associative bash arrays. However, macOS's bash version is stuck on an older version that doesn't support associative arrays. So I removed that from the PR and decided to try it a different way in a future PR as a separate issue.
Description
Create some method of expanding aliases when running
ov
. For example,ov j
should expand toov just
.It should be possible with one-dimensional arrays, and treating odd-or-0 index as the alias and the following even index as the expansion. This would be preferred, as it's probably less overhead than something else (like the Python script).
Another option I thought of was to use Python to process argv in the entrypoint and expand the aliases there. The entrypoint could end with
python ./docker/dev_env/expand_aliases.py "$@"
, and that script could import$OPENVERSE_PROJECT/.ov_aliases.py
using a method like https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly, and then do something like:Alternatives
The text was updated successfully, but these errors were encountered: