asdf icon indicating copy to clipboard operation
asdf copied to clipboard

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

Open kentquirk opened this issue 2 years ago • 5 comments

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.

kentquirk avatar Sep 20 '23 20:09 kentquirk

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

edvardsanta avatar Sep 22 '23 19:09 edvardsanta

@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.

hyperupcall avatar Sep 22 '23 19:09 hyperupcall

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)

janeklb avatar Mar 01 '24 13:03 janeklb

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

dolmen avatar Apr 27 '24 22:04 dolmen