asdf-vm / asdf

Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more
https://asdf-vm.com/
MIT License
22.02k stars 783 forks source link

Please include the config file's name in the error message #1647

Open kentquirk opened 1 year ago

kentquirk commented 1 year ago

Is your feature request related to a problem? Please describe

This is a paper cut, but I've run into it myself.

In a slack I read, this dialog just took place:

Person 1: I think what I hate the most about asdf is that when it yells at you about needing a config file in a folder but doesn’t tell you the name of the config file No version is set for command go

Consider adding one of the following versions in your config file at
golang 1.17.1
golang 1.19.4
golang 1.20.2
golang 1.20.3

endless rage every time

Person 1: it’s apparently .tool-versions, a combination of letters I am guaranteed to get wrong at least three times

Person 2 programs that assume you know how the f*** they work kill me

Describe the proposed solution

The error message should include the name of the file the user is being suggested to edit.

Describe similar asdf features and why they are not sufficient

I'm just asking for a clearer message.

Describe other workarounds you've considered

Not being clear.

edvardsanta commented 1 year ago

So you're just proposing to change "config file" to .tool-versions in the message like "Consider adding one of the following versions in your .tool-versions at"? Anyway, I think it is implicit that it is the asdf's config file

hyperupcall commented 1 year ago

@kentquirk The latest version should include the full path to the .tool-versions file in the error message:

https://github.com/asdf-vm/asdf/blob/4085e5542bac824ea124610ad247c2f90d1b8d93/lib/utils.bash#L831

Which version of asdf are you running? If you are running the latest version, the lack of this file path would be a bug.

janeklb commented 8 months ago

For new asdf users, it would also be nice to include the fact that this message is coming from asdf (and not whatever plugin / executable you just tried to run)

dolmen commented 6 months ago

There is no mention of asdf in the error message. This is just poor UX.

$ node
No version is set for command node
Consider adding one of the following versions in your config file at 
nodejs 14.16.0
nodejs 16.20.2
nodejs 18.18.2
nodejs 21.5.0
$ asdf --version
v0.14.0
0xdnL commented 2 months ago

bump, same here, would be nice to see which config file needs to be changed in the output

kubectl version --client --short
No version is set for command kubectl
Consider adding one of the following versions in your config file at 
kubectl 1.24.17
kubectl 1.31.0