asdf-vm / asdf-vm/asdf

feat: `asdf list` commands to sort output by version, not lexical

Open
#1,428 9 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
25.6k
Forks
941
Avg merge
9h 24m
Merged PRs (30d)
3

Description

### Is your feature request related to a problem? Please describe

`asdf list`, `asdf list python`, etc output version numbers that are lexicographically sorted, e.g.:

```sh
❯ asdf list python
2.7.18
3.10.0
3.10.3
3.10.6
*3.10.9
3.11.1
3.6.15
3.7.14
3.7.6
3.8.13
3.9.11
```

But it'd be nicer to see them version-sorted (example below)

### Describe the proposed solution

Would like to see this:

```sh
❯ asdf list python
2.7.18
3.6.15
3.7.6
3.7.14
3.8.13
3.9.11
3.10.0
3.10.3
3.10.6
*3.10.9
3.11.1
```

### Describe similar `asdf` features and why they are not sufficient

n/a

### Describe other workarounds you've considered

piping to `sort -V` kinda works, but the `*` messes it up

Contributor guide

Open the contributing guide

Research direction

Start at the `asdf list` command entry point and inspect how installed versions are currently ordered and tested. Run the examples from the issue, including `asdf list python`, then verify that all versions use version ordering while the active-version `*` marker remains correctly placed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.