asdf-vm/asdf

Streamline switching between asdf versions (`asdf update <ref>`, `asdf update --interactive`)

hyperupcall opened this issue · 0 comments

Is your feature request related to a problem? Please describe

Right now, there are two ways to update asdf:

  • asdf update
  • asdf update --head

The former updates to the latest stable. The latter updates to the latest, period.

It's difficult to "update" (switch) to a particular version of asdf.

Describe the proposed solution

I propose adding support for (1) an --interactive flag to asdf update and (2) a git ref as the first positional parameter

(2)

The first step is the first step. Should support things like tags, commits, and HEAD. Later, it may be nice to support remote branch names, but that is not necessary right away.

(1)

Flag --interactive simply shows a "scrollable" list of all current release tags and allows one to be selected.

I've made such scrollable lists before and I know how to make a readable and maintainable implementation. It has to be implemented using the bash-term library since tput is wayyy too slow (copying the source files, no package manager). bash-term is over a year old and is stable.

On this selection screen, it may be useful to show which versions have asdf update --interactive. Or, maybe only versions that implement --interactive should be shown (that way, there is not frusterating when switching to a version without asdf update --interactive).

Describe similar asdf features and why they are not sufficient

asdf update --head is similar

Describe other workarounds you've considered

Something like (cd "${ASDF_DIR:-"$HOME/.asdf"}" && git switch <ref> ) is too clunky and not interactive.