jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
8.11k stars 214 forks source link

`mise ls` should star / annotate the current highest-priority version for each plugin it lists #2233

Open johnpyp opened 1 month ago

johnpyp commented 1 month ago

It would be great if mise ls could annotate the current highest-priority version for each plugin it lists. This could be done with a simple * annotation or something similar. E.g:

Today:

❯ mise ls python
Plugin  Version  Config Source              Requested
python  3.8.19   ~/.config/mise/config.toml 3.8
python  3.9.19   ~/.config/mise/config.toml 3.9
python  3.10.14  ~/.config/mise/config.toml 3.10
python  3.11.9   ~/.config/mise/config.toml 3.11
python  3.12.3   ~/.config/mise/config.toml 3.12

❯ python --version # 3.12 is my highest-priority version in `config.toml`
Python 3.12.3

With annotation:

❯ mise ls python
Plugin  Version  Config Source              Requested
python  3.8.19   ~/.config/mise/config.toml 3.8
python  3.9.19   ~/.config/mise/config.toml 3.9
python  3.10.14  ~/.config/mise/config.toml 3.10
python  3.11.9   ~/.config/mise/config.toml 3.11
python  3.12.3*  ~/.config/mise/config.toml 3.12

# or on the last column...
python  3.12.3   ~/.config/mise/config.toml 3.12*

# or maybe just bolding / changing the color?

...or alternatively adding something like a Priority column... maybe with "top" annotation for visual clarity too...

❯ mise ls python
Plugin  Version  Config Source              Requested Priority
python  3.8.19   ~/.config/mise/config.toml 3.8       4
python  3.9.19   ~/.config/mise/config.toml 3.9       5
python  3.10.14  ~/.config/mise/config.toml 3.10      3
python  3.11.9   ~/.config/mise/config.toml 3.11      2
python  3.12.3   ~/.config/mise/config.toml 3.12      1*
jdx commented 1 month ago

I don't think I agree. This is something only relevant to python and it would screw up parsing with awk unless we added a new column. I think a new column is too much noise and confusion for something used by a single language.

jdx commented 1 month ago

you can get this information, however, with the undocumented mise current python

johnpyp commented 1 month ago

This is something only relevant to python

I don't think so, I have multiple global versions for Node / Java / etc. too

mise current python

Yep, I reach for mise ls as a nice "dashboard" for this though

This is something only relevant to python and it would screw up parsing with awk unless we added a new column

Would using a color instead help with this concern?